The creation and customization of database applications using Microsoft Access
The reason for filtering the form rather than navigating to a specific record in my demo is that, in my case, there can be more than one parent record which matches the search criterion, so navigating to a record would just go to the first match. It makes more sense in that context to filter the form so that all of the matching records are together. In yours you could write the code to move the form to the first matching record, as there will be only one record which matches the criterion.
A subform control is a control in a parent form which houses the subform. The subform itself is the source object of the subform control. The control might or might not have the same name as the subform itself.
Where my code refers to ctrl this is an object variable. In my case it returns a reference to the ActiveControl because the code is in the combo box's AfterUpdate event procedure so the ActiveControl is the combo box. The default property of a control is its Value property, so when the code refers to ctrl without specifying any property of it, it is interpreted as a reference to the current value of the control, which in this case is the value of the ContactID field to which the combo box is bound, although the ContactID column is hidden and you see the contact's name from the second column of its RowSource. It would equally well work for a text box, though, because that will probably contain a string rather than a number, the value would need to be wrapped in literal quotes characters, e.g.
WHERE ContactName = """ & ctrl & """)"
In this each literal quotes character is represented by a contiguous pair of quotes characters, "", which is how a quotes character can be included in a string itself delimited by quotes characters. Some people use a single quote character, ' instead, but that would not work with names like mine in its original non-anglicized form, Cináed O'Siridean, because it includes a single quote character as an apostrophe.
You are quite right, the IN operator does return a TRUE or FALSE value. ProjectID is the primary key of the parent form's table, so the expression will return TRUE if the ProjectID of a record in the Projects table has at least one match in the subform's ContactProjects table where the ContactID matches the value of the combo box. The record will thus be returned when the parent form is filtered. Where there is no match it will return FALSE, and then the record won't be returned.