Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search a Macro for text/queryname using VBA

Status
Not open for further replies.

ejsmith

IS-IT--Management
Aug 5, 2001
39
US
I'm attempting to search through all of the macros in a db to find if a certain query is referenced within it. For example, I want to see if the query named "qryThisIsMyQuery" is run from any of the several macros found in the database. This will be used in different databases - so the list of macros is changeable and the name of the query I'll be searching for will change also.
I can iterate throught the application.allmacros collection - but I'm stuck on how to take it further...
Any help would be greatly appreciated!
Here's what I have so far...

Public Sub test()
Dim obj As AccessObject
Dim dbs As Object
Set dbs = Application.CurrentProject

For Each obj In dbs.AllMacros
Debug.Print obj.Name
Next

End Sub


Thanks in advance!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top