I'm not sure if the title of this post makes any sense. Basically, I'm trying to figure out how to refer to a control on a form in a query criteria based on whichever form is "active." The scenario is I have many forms where I have a form control that retains a "master ID" and another control (combo box) that lists associcated "sub IDs." The value of the master ID control is passed to a query parameter that then selects all of the sub IDs that are related, which populates the list in the combo box on the form. But I don't want to create a query for every single form that needs this functionality simply because the form name is different.
Is there a way to make the red outlined portion of the query criteria a "parameter" or "wildcard" such that the form name is popped into this query dependent on whichever form is "active?" Or in other words, is there a way to refer to the form in the query criteria as "Me?" Do I need to generate the SQL syntax using concatenation in VBA and pass that to the query?
See attached JPG of query matrix.
Any help would be appreciated.
Thanks,
David
Is there a way to make the red outlined portion of the query criteria a "parameter" or "wildcard" such that the form name is popped into this query dependent on whichever form is "active?" Or in other words, is there a way to refer to the form in the query criteria as "Me?" Do I need to generate the SQL syntax using concatenation in VBA and pass that to the query?
See attached JPG of query matrix.
Any help would be appreciated.
Thanks,
David
Attachments
Last edited: