Reputation: 5
I am trying to filter a table with a form and I'm having trouble with the macro.
My form is similar to this one and field1 is first name, field2 is city, and field3 is birth year.
I want to run this query on the subform or something similar so it filters the subform based on the combo box parameters.
My issue is with the control name I can't seem to come up with anything that works.
Thank You! Any help will be appreciated!
Upvotes: 0
Views: 2944
Reputation: 1
New here - so couldn't comment or vote on answer above. Using the name of the container worked for me! The container is essentially the yellow subform border when you highlight the subform. The container name is found in property sheet > other > name. And it was searchable in the Control Name box when building the macro.
Property Sheet:
Macro:
Upvotes: 0
Reputation: 21370
Did some testing. The Control Name is the name of the subform container control. In this case it will be the container name only, no Forms!Form1
prefix. Recommend you name the container control different from the object it holds, such as ctrDetails. It works if the container holds a table, query, form, or report.
Upvotes: 0