Table of contents
TOC
Collapse the table of content
Expand the table of content

Module.Type Property (Access)

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

Indicates whether a module is a standard module or a class module. Read-only AcModuleType.

Syntax

expression. Type

expression A variable that represents a Module object.

Example

The following example determines whether a Module object represents a standard module or a class 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

See also

Concepts

Module Object

© 2017 Microsoft