Sub QueryDefSample()
Dim q As QueryDef
For Each q In CurrentDb.QueryDefs
MsgBox q.Name
Next
Set q = CurrentDb.QueryDefs("x"
DoCmd.RunSQL (q.SQL)
End Sub
Use the For Each loop to obtain a list of available queries and place them into the Combobox field list. Then, when the user selects a query from the list, use the second part of the code to run the query that corresponds to their selection. Rob Marriott
rob@career-connections.net
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.