Search modules programmatically

  • Thread starter Thread starter Morten Snedker
  • Start date Start date
M

Morten Snedker

I've made myself some nice code that searches the datasource of all
forms, reports and their controls for a given expression.

However, I wish to search modules as well for a given expression.
Is this possible - and how?


Regards /Snedker
 
Morten said:
I've made myself some nice code that searches the datasource of all
forms, reports and their controls for a given expression.

However, I wish to search modules as well for a given expression.
Is this possible - and how?


Sure you can. There's a bunch of methods of the module
object to do funky things like this.

You can get to each standard or class Module object with
this kind of reference:

For Each doc In dbCur.Containers("Modules").Documents
DoCmd.OpenModule doc.Name

and go from there.

Form and Report modules are available when you open the
form/report in design view:

For Each doc In dbCur.Containers("Forms").Documents
DoCmd.OpenForm doc.Name, acDesign
With Forms(doc.Name)
If .HasModule Then

Check Help to see the methods of the Module object.
 
Back
Top