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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multi-module "Find" for Access VBA IDE?

Status
Not open for further replies.

BruceG

Programmer
Dec 9, 2001
31
US
Hello there,
I am a veteran of straight VB programming, but less of a veteran in Access VBA application development. I am currently working on a large Access application, and I want to search for a particular string across any module (form, report, VB module) that has code in it. (For those of you familiar with straight VB, this is like a project-scope search - however, the concept of an Access project seems to be different.)

For example - I have the code window open for "Form X". I do a "Find" for the string "Integer", specifying "Project" scope. However, the search seems limited to Form X. In straight VB (e.g. VB6 6), repeated clicking of the "Find Next" button would open and find any and all modules, forms, and classes that contained the string "Integer". How do I replicate this behavior in Access?

Thanks for any insight you can provide.
 
It should work, as you explained using "Project Scope".
Possibly the string search you defined, is not accurate; "Find Whole Word Only", "Match Case", "pPattern Matching".

Even still though, I'd think you'd get a reaction.

I have noticed though, if I move my cursor during a find, I get unpredictable results sometimes. I then need to reset or unhighlight the cursor, and press find again.

...Bruce, are you talking doing a search via VBA?
If so, could we see the code? It sounds like a parameter is slightly off?
 
Actually Bruce, I retract.
That option may not be available in VBA yet.
You may need to loop through the module collection, and do a find action during each iteration.

For Each mdl In CurrentProject.AllModules
DoCmd.OpenModule mdl.Name
Set mdl = Modules(mdl.Name)

If mdl.Find("Integer", lngSLine, lngSCol, lngELine,lngECol) Then
......

Next

The Find method for modules, i found in VBA help.

...I'm still not sure, if we're talking of the same thing?

You did say ANY insight (LOL)!
 
Thanks for responding, Zion7, I will take it under advisement.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top