This is driving me crazy! I am looking open a second form to the record based on the first form.
I have two forms (Search By Accounting Code & MEMBERS) The MEMBERS Form has multiple sub forms and is very useful in looking at the billing, services and notes for each member; however, i can only search by fields in the Orginal form. To get around this, I created search forms accessiable by my switchboard and linked to a query. For instance on the Search By Accounting Code Form i would give the parameters and it would return the Accounting Code, Member Name and Member_ID_Code (primary key on the table associated with the form l want the command button to open)
I created a Command button on the Search By Accounting Code Form and used the following code
DoCmd.OpenForm "MEMBERS", , , "Member_ID_Code = '" & Me.ControlName & "'"