ASH
ASH

Reputation: 5

How do I to filter a subform in Access? What is the control name?

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. Link to Picture one

I want to run this query on the subform or something similar so it filters the subform based on the combo box parameters. Link to picture Two

My issue is with the control name I can't seem to come up with anything that works. Link to Picture Three

Thank You! Any help will be appreciated!

Upvotes: 0

Views: 2944

Answers (2)

Nathan Gonzalez
Nathan Gonzalez

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:

Property Sheet

Macro:

Macro

Upvotes: 0

June7
June7

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.

enter image description here

Upvotes: 0

Related Questions