Hi,
I am trying to open a form (Form B) from Form A by making a VBA code with "DoCmd.OpenForm" and apply the where clause on the current ID field.
This is working great when in the form that opens, the ID field is in the main form.
However, i want to go one step further and open a form with a subform, where the subform needs to only display the corresponding fields of the Id field from form A.
The code I have tried to make is the below by double click on the person Id field on Form A in the demofile:
I do not understand why the above code is not working.
Could somebody help me fix this problem ?
I am trying to open a form (Form B) from Form A by making a VBA code with "DoCmd.OpenForm" and apply the where clause on the current ID field.
This is working great when in the form that opens, the ID field is in the main form.
However, i want to go one step further and open a form with a subform, where the subform needs to only display the corresponding fields of the Id field from form A.
The code I have tried to make is the below by double click on the person Id field on Form A in the demofile:
Code:
DoCmd.OpenForm "FormB", _
WhereCondition:="Forms.FormB.Friends.Form.PersonId=" & Me.PersonId
I do not understand why the above code is not working.
Could somebody help me fix this problem ?
Attachments
Last edited: