Create a table listing queries

  • Thread starter Thread starter Deb Roberts
  • Start date Start date
D

Deb Roberts

Does anyone know of a way to create a table that lists all queries in my
database?? I'd like a user to be able to create a custom query and then
have that query saved into a table, so that they can then access the query
from the table later.

My reason for this is that the end users won't see the database window, so
won't be able to save a query as you normally would.

Cheers

Deb Roberts
 
This query should return the names of all user-defined queries in your
database:

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

If you use a query instead of a table, you won't have to worry about
updating it when queries are added.

HTH
- Turtle
 
Create a new query. Go to the SQL view, and paste in:

SELECT MsysObjects.Name INTO Queries
FROM MsysObjects
WHERE (((MsysObjects.Type)=5) AND ((Left([Name],1))<>"~"));

This will create a table called "Queries" listing all user-created
queries in the database. (Access saves all the queries associated with
combo-box row sources, etc, as hidden objects whose name begins with
"~").
 
Back
Top