DoCmd.OpenModule (Access)

The OpenModule method carries out the OpenModule action in Visual Basic.

You can use the OpenModule method to open a specified Visual Basic module at a specified procedure. This can be a Sub procedure, a Function procedure, or an event procedure. You must include at least one of the two OpenModule action arguments. If you enter a value for both arguments, Access opens the specified module at the specified procedure.

OpenModule (ModuleName, ProcedureName)


DoCmd.OpenModule "Utility Functions", "IsLoaded"

Arguments

Optional arguments

The following arguments are optional

ModuleName (String) - A string expression that's the valid name of the Visual Basic module that you want to open. If you leave this argument blank, Microsoft Access searches all the standard modules in the database for the procedure that you selected with the ProcedureName argument and opens the module containing the procedure to that procedure. If you execute Visual Basic code containing the OpenModule method in a library database, Access looks for the module with this name first in the library database, and then in the current database.

ProcedureName (String) - A string expression that's the valid name for the procedure that you want to open the module to. If you leave this argument blank, the module opens to the Declarations section.