You can't do parameterized queries in 2007 (but you can in 2010), however ,all you need to do is filter the repeating table using conditional formatting that says "if projectID (or projectname or any other unique identifier) from the secondary data connection is not equal to the projectID saved in the form's main data source, then hide control." When you apply this conditional formatting to a repeating table, it hides all rows that don't match. The resulting row in this case would be the row corresponding to the current form, and you would only display the columns for Modified and ModifiedBy.
You start by making your data connection and then dragging the repeating group of that data connection to the canvas. Remove all columns other than the two you mentioned, then set the conditional formatting. It will always only show one row as long as you use a unique identifier. You just need to remember to set that unique identifer within a hidden field in the form template schema.
If you want to use the ID, then I have a method for retrieving that from within your form upon submission:
InfoPath – Auto-Numbering Forms
As a teaser, in InfoPath 2010 and SharePoint 2010, you'll be able to first choose the query parameter (projectID in this case), send it to the SharePoint list data connection, and then retrieve ONLY the relevant record(s) based on the query. This allows you to do server-side queries and only download the smallest set of data that is necessary to fulfill the query. That is a huge thing...
In 2007, you can only do this dynamic querying with custom code or by using the handy dandy tools provided by Qdabra - the company who runs this forum. Check out their product list, because they have a Query Builder tool and the ability to dynamically change filtered SP data connections based on data chosen in the form.