View Full Version : Exporting Query Design.


Heckles
04-24-2008, 02:17 AM
Hi All,
I am currently in the process of writing a manual for one of our access database systems (it's written in a modified version of access). Unfortunately this database was not written by me and has many different queries which in the end returns a number of export files... Obviously I could look through each query one by one and copy the details down into a table in word or whatever.

I am just wandering is there any way to export the design of the query itself or even print it out, as obviously I could then complete a Visio like diagram and include that in the appendix of the manual.

Searched google and the access help and what not but I can't seem to come up with anything :(

namliam
04-24-2008, 02:30 AM
Could this code help you in some way??


Sub ListQueries()
Dim qdf As DAO.QueryDef
For Each qdf In CurrentDb.QueryDefs
Debug.Print qdf.Name
Debug.Print qdf.SQL
Next
End Sub
Paste it into a module and execute it. It should list all the query names + sql in the Immediate window, from where you can copy paste it...

neileg
04-24-2008, 04:22 AM
What you see in the query design window is a graphical representation of the SQL that Access runs. You can screen grab the query design view but if the query is even slightly complex you wont get all the information from a screen grab. As namliam indicates, copying the SQL will give you the full detail, but this may not be user friendly.

Mind you, if I was doing a user manual I wouldn't be giving details of the queries. Users see forms and reports, not queries.