在MS Access VBA中等待表单关闭的最佳方法是什么?

Lan*_*rts 5 forms ms-access vba wait

我从一个模块调用一个Form,并希望在完成该模块的其余部分之前等待Form关闭.什么是等待的正确方法?

我有一个IsOpen("formname")函数来检查表单是否仍然打开.

Ahm*_*mad 5

WindowMode:=acDialog你启动时设置DoCmd.OpenForm

以下是从其他Office VBA(Excel,Word,VB6,VB.Net)完成的操作.使用以下代码以模态方式调用表单

Dim f as new FormNameHere
f.Show True  'True is the option for Dialog in VB
' form will be displayed until the user dismisses it then execution continues
set f = Nothing
Run Code Online (Sandbox Code Playgroud)

除此以外:

f.ShowDialog
Run Code Online (Sandbox Code Playgroud)

  • 这是一个格式非常糟糕的答案,因为第一行之后的所有内容都与 Access 完全无关。 (3认同)