Table of contents
TOC
折叠目录
展开目录

DoCmd.OpenModule 方法 (访问)DoCmd.OpenModule Method (Access)

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

OpenModule方法执行 Visual Basic 中的 OpenModule 操作。The OpenModule method carries out the OpenModule action in Visual Basic.

语法Syntax

表达式OpenModule(* * ModuleName,* * ProcedureName ** )expression. **OpenModule( ** ModuleName, ** ProcedureName )

表达式_一个表示DoCmd对象的变量。_expression A variable that represents a DoCmd object.

参数Parameters

名称Name必需/可选Required/Optional数据类型Data Type说明Description
ModuleNameModuleName可选OptionalVariantVariant要打开 Visual Basic 模块的有效名称的字符串表达式。如果将该参数留空,Microsoft Access 会在数据库中为过程使用_procedurename_参数选择和打开包含该过程的步骤的模块中搜索所有的标准模块。如果执行 Visual Basic 代码包含在某个类库数据库中的OpenModule方法时,Microsoft Access 将寻找先在类库数据库中,然后在当前数据库中同名的模块。A string expression that's the valid name of the Visual Basic module you want to open. If you leave this argument blank, Microsoft Access searches all the standard modules in the database for the procedure 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, Microsoft Access looks for the module with this name first in the library database, then in the current database.
ProcedureNameProcedureName可选OptionalVariantVariant字符串表达式,表示您要打开模块以显示的过程的有效名称。如果将该参数保留为空,打开模块时将显示声明节。A string expression that's the valid name for the procedure you want to open the module to. If you leave this argument blank, the module opens to the Declarations section.

注解Remarks

OpenModule方法可用于打开指定的 Visual Basic 模块在指定的过程。这可以是一个 Sub 过程、 函数的过程中或事件过程。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.

OpenModule 操作的两个参数必须至少设置一个。如果同时设置两个参数,则 Microsoft Access 将在指定过程中打开指定的模块。You must include at least one of the two OpenModule action arguments. If you enter a value for both arguments, Microsoft Access opens the specified module at the specified procedure.

示例Example

下面的示例打开实用程序函数模块 IsLoaded ()函数过程:The following example opens the Utility Functions module to the IsLoaded( ) Function procedure:

DoCmd.OpenModule "Utility Functions", "IsLoaded"

另请参阅See also

概念Concepts

DoCmd 对象DoCmd Object

© 2018 Microsoft