
Accessing Report 'Record Source' field
Hi Keith,
Use the Reports Container.
'*********** Code start ***********
Sub sEnumRpts()
Dim db As Database, ctr As Container
Dim doc As Document, rpt As Report
Set db = CurrentDb
Set ctr = db.Containers!Reports
For Each doc In ctr.Documents
With doc
DoCmd.OpenReport .Name, acViewDesign
Set rpt = Reports(.Name)
Debug.Print rpt.RecordSource
DoCmd.Close acReport, .Name, acSaveNo
End With
Next
Set rpt = Nothing
Set doc = Nothing
Set ctr = Nothing
Set db = Nothing
End Sub
'********** Code End *************
HTH
--
Dev Ashish (Just my $.001)
---------------
The Access Web ( http://home.att.net/~dashish )
---------------
:How do I loop through all the reports in an application an access their
:'record source'?
:
: