Find Report Record source

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Knowing the report name, how do I programatically get the "recordsource"
(query name) from a report.
 
Most of the properties are available only when the report is open, so:

Dim strDoc As String
strDoc = "Report1"
DoCmd.OpenReport strDoc, acViewDesign, WindowMode:=acHidden
Debug.Print Reports(strDoc).RecordSource
DoCmd.Close acReport, strDoc

Note: The WindowMode argument will not work with earlier versions of Access.
 
Back
Top