none
What are the properties/attributes that show a Module is a Class? RRS feed

Answers

  • Hi,

    Do you want to check if there are any properties or attributes to distinguish Standard Modules and Class Modules?

    You could use Module.Type Property (Access) to check the type of module.

    E.g.

    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

    Regards,

    Celeste

    • Marked as answer by Peter N Roth Tuesday, October 25, 2016 3:14 AM
    Tuesday, October 25, 2016 2:22 AM
    Moderator