Module.Type (Access)

Indicates whether a module is a standard module or a class module. Possible return values are acClassModule - The specified module is a class module, acStandardModule - The specified module is a standard module.


Function CheckModuleType(strModuleName As String) As Integer 
 Dim mdl As Module 
 
 ' Open module to include in Modules collection. 
 DoCmd.OpenModule strModuleName 
 ' Return reference to Module object. 
 Set mdl = Modules(strModuleName) 
 ' Check Type property. 
 If mdl.Type = acClassModule Then 
 ' Insert comment. 
 mdl.InsertLines 1, "' Class module." 
 CheckModuleType = acClassModule 
 Else 
 ' Insert comment. 
 mdl.InsertLines 1, "' Standard module." 
 CheckModuleType = acStandardModule 
 End If 
End Function