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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top