Determine Module Type

D

DevlinM

I want to collect information about each module in my DB. I am using the
AccessObject properties to retrieve dates and so forth. However, using the
property "Type" does not return expected results. All modules return as 5.
I want to distinguish a class module from a standard module. Is this
possible?

Thanks

Devlin
 
M

Marshall Barton

DevlinM said:
I want to collect information about each module in my DB. I am using the
AccessObject properties to retrieve dates and so forth. However, using the
property "Type" does not return expected results. All modules return as 5.
I want to distinguish a class module from a standard module. Is this
possible?

You need to use the module object type property, not the
AccessObject type property.

For Each ao In AllModules
. . .
DoCmd.OpenModule ao.Name
moduletype = Modules(ao.Name).Type
. . .
DoCmd.Close acModule, ao.Name, acSaveNo
 
D

DevlinM

Thank you for your help!

Marshall Barton said:
You need to use the module object type property, not the
AccessObject type property.

For Each ao In AllModules
. . .
DoCmd.OpenModule ao.Name
moduletype = Modules(ao.Name).Type
. . .
DoCmd.Close acModule, ao.Name, acSaveNo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top