[AccessD] Report / Query Cross Reference

roz.clarke at barclays.com roz.clarke at barclays.com
Fri May 14 09:48:49 CDT 2010


Brad,

I can confirm that you do need to open a report before you can access
its recordsource (same for forms).

This should do it:


Dim rpt As Report
Dim strReportName as string

For Each rpt in Application.CurrentProject.AllReports

	strReportName = rpt.Name
    	
	If IsLoaded(strReportName) = False Then
      	DoCmd.OpenReport ReportName:=strReportName, View:=acDesign
	End If
	
	debug.print rpt.recordsource
       
      DoCmd.Close acReport, rpt.Name, acSaveNo
          
Next


Roz

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin
Sent: 14 May 2010 14:41
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Report / Query Cross Reference

Brad:

Here's a bit of code that will cycle through all the reports, and show
the report name, but I don't know how to get the record source. I think
you may have to open the report in design view to extract that property.
At that point I'd write the report name and record source to a temp
table and print the report from the table.


Dim Doc As Document

Dim db As DAO.Database

Set db = CurrentDb

With db.Containers("reports")

For Each Doc In .Documents
    MsgBox Doc.Name
Next Doc

End With


HTH

Rocky


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks
Sent: Friday, May 14, 2010 4:15 AM
To: accessd at databaseadvisors.com
Subject: [AccessD] Report / Query Cross Reference

We have a growing number of Access 2007 Reports.

All reports use Queries for their Record-Source.



Is it possible to create a simple and concise cross-reference report
that shows Report Name and Record Source?  In our case this would be a
query name.



Here is a small sample of what we would like to see.



~~~~~~~~~~~~~~~~~~~~~~~~~~



REPORT-NAME     RECORD-SOURCE(QUERY)



Report001                     Query098

Report002                     Query499

Report003                     Query372



~~~~~~~~~~~~~~~~~~~~



We have looked at the Access 2007 internal "sys" tables, but cannot
figure out how to obtain this info (or if this is even possible).



We know that we can obtain this info via the Database Documenter, but
the report from this tool contains way more info than we need.



There is probably a simple way to do this, but we cannot figure it out.



Thanks,

Brad
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

This e-mail and any attachments are confidential and intended solely for the addressee and may also be privileged or exempt from disclosure under applicable law. If you are not the addressee, or have received this e-mail in error, please notify the sender immediately, delete it from your system and do not copy, disclose or otherwise act upon any part of this e-mail or its attachments.

Internet communications are not guaranteed to be secure or virus-free.
The Barclays Group does not accept responsibility for any loss arising from unauthorised access to, or interference with, any Internet communications by any third party, or from the transmission of any viruses. Replies to this e-mail may be monitored by the Barclays Group for operational or business reasons.

Any opinion or other information in this e-mail or its attachments that does not relate to the business of the Barclays Group is personal to the sender and is not given or endorsed by the Barclays Group.

Barclays Bank PLC.Registered in England and Wales (registered no. 1026167).
Registered Office: 1 Churchill Place, London, E14 5HP, United Kingdom.

Barclays Bank PLC is authorised and regulated by the Financial Services Authority.




More information about the AccessD mailing list