Create a table listing queries

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
 
M

MacDermott

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
 
C

Charles Coleman

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
"~").
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top