DoCmd.OpenModule method (Access)
The OpenModule method carries out the OpenModule action in Visual Basic.
Syntax
expression.OpenModule (ModuleName, ProcedureName)
expression A variable that represents a DoCmd object.
Parameters
Name | Required/Optional | Data type | Description |
---|---|---|---|
ModuleName | Optional | Variant | 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 | Optional | Variant | 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. |
Remarks
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.
Example
The following example opens the Utility Functions module to the IsLoaded( ) Function procedure.
DoCmd.OpenModule "Utility Functions", "IsLoaded"
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기