Open a form and go to a specific record in a subform
Posted on 2010-11-14
In the database a form open when I click on a button from another form. It should d go to a specific record in a subform. Right now I am able to open a form and go to a record on a main form using the code:
DoCmd.SearchForRecord , "", acFirst, "[x] = " & Str(Nz(Screen.ActiveControl, 0))
How do I do this but go to a record in a sub-form? The main form is called Company and the subform is called Employee.
I need to open a form and go to an employee in a particular company (an contact can work for multiple companies so it is more than a 1-to-1 relationship in this which is making it a bit tricky from a coding perspective so I need to use the company ID also).