Access 2010: I created a combo box on a form, the form does not know about the combo box

marjorie estrada
marjorie estrada used Ask the Experts™
I have a form with a combo box, the dropdown list have all the queries.  My idea was to selecta query the userend wants to view, and it reveals the current query.  The form does not know about the combo box, i'm a new programmer;  i am not sure how to perform this action through a selection.  

I'm not sure i should even have a combo box to view any query a userend should select to see.  My destination is to have a button on a form to do select (view any query).
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Do you like to view SQL code or run query?
Distinguished Expert 2017

Typically when you are building apps for other people, you would create forms and reports.  You would NOT give the user raw queries to view.  Keep in mind that if the query is updateable, the user has unfettered access to the data and you have no ability to validate anything he does.

If you still want to do this, then use DoCmd.OpenQuery and reference the name of the combo.
Top Expert 2009

It is better to select data and display the results on a form (or subform).  See my Fancy Filters sample database; here is a screen shot of the form:

Fancy Filters

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial