Inquisitor99
Programmer
I have a main form with a linked subform. I have a text box on the main form allowing the user to enter data that they want to use to filter the form.
This works fine when the field being filtered is on the main form. It does not work at all when the field being filtered is on the subform.
How do I filter the subform, so that both the main form and the subform move to the corresponding record and remain synchronized?
Example:
To look up an ID# located on the MAIN form, I use the following, which works fine:
Me.Filter = "[ID#]=" & Me!LookupTextBox
Me.FilterOn = True
To look up a name on the subform, for example, I tried to use the following, which does not work:
Me.[mySubform].Form.Filter = "[Name]=" & Me!LookupTextBox
Me.[mySubform].Form.FilterOn = True
I want the subform to move to the record containing the 'Name' specified, and I want the main form to also move its pointer to the correct record to remain synchronized with the subform.
I now see why it does not work, because the subform will always have just the one record that is linked to the main form.
How can I work around this? Does anybody have any ideas?
Thanks.
This works fine when the field being filtered is on the main form. It does not work at all when the field being filtered is on the subform.
How do I filter the subform, so that both the main form and the subform move to the corresponding record and remain synchronized?
Example:
To look up an ID# located on the MAIN form, I use the following, which works fine:
Me.Filter = "[ID#]=" & Me!LookupTextBox
Me.FilterOn = True
To look up a name on the subform, for example, I tried to use the following, which does not work:
Me.[mySubform].Form.Filter = "[Name]=" & Me!LookupTextBox
Me.[mySubform].Form.FilterOn = True
I want the subform to move to the record containing the 'Name' specified, and I want the main form to also move its pointer to the correct record to remain synchronized with the subform.
I now see why it does not work, because the subform will always have just the one record that is linked to the main form.
How can I work around this? Does anybody have any ideas?
Thanks.