Yes, Access projects have an AllReports collection which you can "enumerate"
(loop through... you will have to open each Report in the collection in
Design View, however, to examine the RecordSource). And, remember that there
are multiple ways to specify the same thing: a table name, or an SQL
Statement that retrieves the information (which may refer to one or more
tables, and may retrieve all, or just some, of the fields).
I don't have an example for Reports, but here are pertinent statements from
an example that I used to go through the AllModules collection:
Dim obj1 As AccessObject, dbs1 As Object
Dim mod1 As Module, frm1 As Form
Set dbs1 = Application.CurrentProject
For Each obj1 In dbs1.AllModules
If obj1.Name <> "basDesignTimeCode" Then
If obj1.IsLoaded = True Then
... do something
Else
DoCmd.OpenModule obj1.Name
CurrentObjectType = obj1.Type
CurrentObjectName = obj1.Name
... do something
DoCmd.Close acModule, obj1.Name ', acSaveYes
End If
End If
Next obj1
I find it difficult to imagine anyone using Macros in an Access project. I
certainly don't have any examples using Macros -- an Access project is, by
my definition, a developed application and the only Macro I'd think about
using in a developed application would be AutoKeys. But, surely enough,
there is an AllMacros Collection and decent help on how to use it in Access
2002 (if you're using Access 2003, it may be more difficult to find the help
you need).
Larry Linson
Microsoft Access MVP
Larry Linson
Microsoft Access MVP
"Matt" <mh******@yahoo.com> wrote in message
news:5f*************************@posting.google.co m...
I inhereted a rather extensive MS Access 2000 database (SQLServer 2000
backend)in adp format.
Is there a way to search the Access front end for references to
specific database objects?
Let's say there are 100 macros and I want to know if any of them use a
particular stored procedure. I'd hate to have to manually look in all
100 macros.
Or, suppose I wanted to see if a stored procedure was used as a
recordsource for any number of 100 or so reports. What's the most
efficient way of doing so?
Thanks for any light you can shed!
Matt