Queries in a list box

jonamua1971

Registered User.
Local time
Today, 09:25
Joined
Mar 3, 2007
Messages
97
i would like create a form with a single list box and that have all the Queries showing so the user can just click the button and run the query.
i have tried one but its not showing the queries. please help!
Thanks for your help
 
Just off the top of my head (I'm sure some will correct me if I'm wrong) I don'k think you can accomplish this using a list or combo box.

Have you considered placing command buttons on the form to do the same thing? This somthing you CAN do.
 
i would like create a form with a single list box and that have all the Queries showing so the user can just click the button and run the query.
i have tried one but its not showing the queries. please help!
Thanks for your help

Yes, you can do this:

Set the rowsource for a list box to this:

SELECT MSysObjects.Name, MSysObjects.Type
FROM MSysObjects
WHERE (((MSysObjects.Type)=5) AND ((Left([Name],1))<>"~"))
ORDER BY MSysObjects.Name;

And then in the click event of the button use

DoCmd.OpenQuery Me.YourListBoxName

But I would highly suggest you don't let users work in queries directly, but use forms as you have more control over things, including data integrity.
 

Users who are viewing this thread

Back
Top Bottom