Hi,
I would like a list of all the queries and tables in a database. Is there a way to "query" the database and download (to Excel/word) the list of queries and tables?
Thank you
Scoobs
Hi,
I would like a list of all the queries and tables in a database. Is there a way to "query" the database and download (to Excel/word) the list of queries and tables?
Thank you
Scoobs
Code:Public Sub dpAllQrys() Dim db As Database Dim qdf As QueryDef dim tdf as tabledef Dim sSql As String Set db = CurrentDb debug.print "tables" For Each tdf In db.tableDefs Debug.Print tdf.name Next debug.print "queries" For Each qdf In db.QueryDefs Debug.Print qdf.name Next Set tdf= Nothing Set qdf = Nothing Set db = Nothing End Sub
If you want to output the list to a file instead of the debug.print statement ranman posted you could create a text file pretty easily with the filesystemobject commands
dim fs
dim f
set fs = createobject("scripting.filesystemobject")
set f = fs.createtextfile("c:\test\TablesandQueries.txt")
then instead of the debug.print use f.writeline
and close it with
set f = nothing
set fs = nothing
You can also use the Database Documenter under Database Tools. You will have the option to document pretty much anything and everything about your database. And the report generated will be quite in-depth.