Determine Module Type

  • Thread starter Thread starter DevlinM
  • Start date Start date
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
 
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
 
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
 
Back
Top