Printing Record Source for a List of Reports

  • Thread starter Thread starter Jim Pockmire
  • Start date Start date
J

Jim Pockmire

I have a table containing a list of reports in an mdb. How can I loop
through the list, printing the record source for each report?
 
I have a table containing a list of reports in an mdb. How can I loop
through the list, printing the record source for each report?

To get the record =source for all of the reports in the Db:
1) Tools + Analyze + Documenter

2) or.. in a Module:

Public Sub ShowRecordsource()
' Print out the RecordSource for each report.
Dim doc As Document
Dim db As DAO.Database
Set db = CurrentDb
For Each doc In db.Containers("Reports").Documents
DoCmd.OpenReport doc.Name, acViewDesign, , , acHidden
Debug.Print "Report Name: " & doc.Name
Debug.Print "Record Source: " & Reports(doc.Name).RecordSource
Debug.Print
DoCmd.Close acReport, doc.Name
Next doc
End Sub
 
Back
Top