View query names in a combo box

Arry

Registered User.
Local time
Today, 19:13
Joined
Oct 24, 2003
Messages
31
I would like to view all of my query names from within a form using a combo box. Is this possible.

I would like to do this so the user can select what query to run or delete.

I cannot reference the query via a button etc... as the user can make new queries and name it as whatever they want.

Does that make sence?
 
If you have prefixed your queries with qry then it's a simple as making this the SQL for the combo's RowSource:

SELECT Mid(Name,4) AS MyQueries FROM MSysObjects
WHERE Left(Name, 3) = "qry" ORDER BY Mid(Name,4);
 
Following gives you queries and tables

SELECT MsysObjects.Name AS ObjectName, IIf([type]=1 Or [type]=6,"Table","Query") AS ObjectType FROM MsysObjects WHERE (((Left$([Name],1))<>"~") AND ((Left$([Name],4))<>"Msys") AND ((MsysObjects.Type)=1 Or (MsysObjects.Type)=5 Or (MsysObjects.Type)=6) AND ((MsysObjects.Flags)=2097152 Or (MsysObjects.Flags)=128 Or (MsysObjects.Flags)=0 Or (MsysObjects.Flags)=16)) ORDER BY MsysObjects.Name;
 
Triffic.

Many Thanks for your help.
 

Users who are viewing this thread

Back
Top Bottom