Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print List of Queries

Status
Not open for further replies.

seashore67

Technical User
May 27, 2003
51
US
Is there any method to print my list of queries I have developed. I just want a list so I can show my supervisors what we have queried and what we do not. Thanks.

Andrew
 
menu Tools -> Analyze -> Documentation -> Queries

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
I would like to use this also, but I find my machine locks up anytime it comes to a query that is based on an ODBC data source.

Any way around that?

Thanks,
ChaZ

Ascii dumb question, get a dumb Ansi
 
Possibly overkill, or even not what you're looking for, but just in case it is. Following is courtesy of Duane Hookum.

Copy/paste it into a new module, open an immediate window and run the code. You can copy/paste the results whereever you need them. Note that it handles Access Projects, too.

Option Compare Database
Option Explicit
Public Sub ListObjects()

Dim obj As AccessObject, dbs As Object, dbType As String
dbType = Right(Application.CurrentProject.NAME, 3)

If dbType = "mdb" Or dbType = "adp" Then
Set dbs = Application.CurrentData
Debug.Print "Tables:"
For Each obj In dbs.AllTables
Debug.Print " " & obj.NAME
Next obj

Set dbs = Application.CurrentProject
Debug.Print "Forms:"
For Each obj In dbs.AllForms
Debug.Print " " & obj.NAME
Next obj

Set dbs = Application.CurrentProject
Debug.Print "Reports:"
For Each obj In dbs.AllReports
Debug.Print " " & obj.NAME
Next obj

Set dbs = Application.CurrentProject
Debug.Print "Macros:"
For Each obj In dbs.AllMacros
Debug.Print " " & obj.NAME
Next obj

Set dbs = Application.CurrentProject
Debug.Print "Modules:"
For Each obj In dbs.AllModules
Debug.Print " " & obj.NAME
Next obj
End If

If dbType = "mdb" Then
Set dbs = Application.CurrentData
Debug.Print "Queries:"
For Each obj In dbs.AllQueries
Debug.Print " " & obj.NAME
Next obj
End If

If dbType = "adp" Then
Set dbs = Application.CurrentData
Debug.Print "Stored Procedures:"
For Each obj In dbs.AllStoredProcedures
Debug.Print " " & obj.NAME
Next obj

Set dbs = Application.CurrentData
Debug.Print "Views:"
For Each obj In dbs.AllViews
Debug.Print " " & obj.NAME
Next obj
End If

Set dbs = Nothing

End Sub

HTH,
Bob [morning]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top