Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ComboBox Query Select

Status
Not open for further replies.

kevinnaomi

IS-IT--Management
Sep 26, 2002
81
US
I have created a database, and there are about 50 queries.
These queries relate to 3 different sections.
I want to create 3 combo boxes that when items within the combo box are selected, the assigned query runs.
Is this possible?
How can I create a combo box that will allow me to select a query and run it?

If anyone can help it would be greatly appreciated.
 
You can create a table that has two fields - queryname and sectionname. Enter query names and section names into the table. Then use this table as the row source of the three combo boxes.
For one combo box (assuming the name is combo1), after it is select, the code should be

docmd.openquery combo1

Good luck.

Seaport
 
Thank you for this advice.
Just to let you know, I created a table with the query names. I created it with the names organized by columns.
First column being ID, second - Desktops, third - Laptops and fourth - Monitors.
Then I added your code to the afterupdate action.
At first it didn`t work, but when I added to it, everything was OK. Here is how the line of code looks now.

DoCmd.OpenQuery (Combo30.Column(1))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top