report showing record source of forms and reports

S

susanhull

Is there a tool in Access that creates a report showing the record
source for my reports and forms? Or is there a way to generate a
report that shows if a query is being used in a report or form?

Thanks in advance for your advice.

Susan
 
A

Allen Browne

There's a built-in documenter that provides some info on the forms/reports:
Tools | Analyze | Documenter

Jeff Conrad has a more extensive documenter here:
http://home.bendbroadband.com/conradsystems/accessjunkie/csdtools.html

If you want to code it (assuming Access 2000 or later), loop through the
AllForms or AllReports collection. This kind of thing:

Public Function ShowRecordSource()
Dim accobj As AccessObject
Dim strDoc As String

For Each accobj In CurrentProject.AllForms
strDoc = accobj.Name
If accobj.IsLoaded Then
Debug.Print strDoc, Forms(strDoc).RecordSource
Else
DoCmd.OpenForm strDoc, acDesign, WindowMode:=acHidden
Debug.Print strDoc, Forms(strDoc).RecordSource
DoCmd.Close acForm, strDoc
End If
Next
End Function
 
Top