[AccessD] Need to Find Access Report that is using a Specific Query

Dan Waters df.waters at outlook.com
Thu Feb 4 17:09:43 CST 2016


Hi Brad - I think this will work!

Just put this into a module and then run it.

----------------------------------------------------------------

Private Sub ChangeReportProperties()

    Dim aob As AccessObject
    Dim obj As Object
    Dim stgName As String
    Dim rpt As Report

    Set obj = Application.CurrentProject

    ' Search for open AccessObject objects in AllReports collection.
    For Each aob In obj.AllReports
    
        stgName = aob.Name
        DoCmd.OpenReport stgName, acViewDesign
        Set rpt = Reports(stgName)
        
        If rpt.RecordSource = "QueryName" Then
            Stop
        End If
         
        DoCmd.Close acReport, stgName
        DoEvents
        
    Next aob

End Sub

----------------------------------------------------------------

-----Original Message-----
From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of
Brad Marks
Sent: Thursday, February 04, 2016 4:51 PM
To: Access Developers discussion and problem solving
Subject: [AccessD] Need to Find Access Report that is using a Specific Query

All,

I am working with a very large Access application that has many reports and
many queries.

I would like to find the name of a report that is using a specific query.  

Is there an easy way to do this?

Thanks,
Brad 

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



More information about the AccessD mailing list