Query List (1 Viewer)

JudyHNM

Registered User.
Local time
Today, 07:20
Joined
Oct 5, 2006
Messages
37
I am using Access 2016, Window 10. Is there a way to get a list of all the queries in the database? Also, is there a way to find out where each query is used and print a report?

Thanks, Judy
 

isladogs

MVP / VIP
Local time
Today, 14:20
Joined
Jan 14, 2017
Messages
18,246
To get a list of queries, use this:

Code:
SELECT MSysObjects.Name
FROM MSysObjects
WHERE (((MSysObjects.Flags)<>3) AND ((MSysObjects.Type)=5));

Not clear exactly what you mean by 'where each query is used'
Try using Object Dependencies in Database Tools
 

JudyHNM

Registered User.
Local time
Today, 07:20
Joined
Oct 5, 2006
Messages
37
To get a list of queries, use this:

Code:
SELECT MSysObjects.Name
FROM MSysObjects
WHERE (((MSysObjects.Flags)<>3) AND ((MSysObjects.Type)=5));

Not clear exactly what you mean by 'where each query is used'
Try using Object Dependencies in Database Tools

Sorry. I mean a list of all the reports and/or form used by the query.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 09:20
Joined
Feb 19, 2002
Messages
43,346
Object Dependencies will give you the uses and used by information but not in any printable format. Total Access Analyzer by FMSINC.com is an excellent tool for documenting a database. It isn't free but it will save you a lot of time and produces lots of useful outputs. Crystal has also produced a documentation tool. It is less extensive but still useful. I don't have a link handy and I don't know how much she charges for it.

Keep in mind that NO tool will report on embedded SQL. So, if you have queries that you build in code or use directly as RecordSources, they will not be included in any reports. The tools report only on querydefs.
 

JudyHNM

Registered User.
Local time
Today, 07:20
Joined
Oct 5, 2006
Messages
37
To get a list of queries, use this:

Code:
SELECT MSysObjects.Name
FROM MSysObjects
WHERE (((MSysObjects.Flags)<>3) AND ((MSysObjects.Type)=5));

Not clear exactly what you mean by 'where each query is used'
Try using Object Dependencies in Database Tools

oops - forgot to thank you for the code to list all the queries. It worked perfectly.
 

Users who are viewing this thread

Top Bottom