【问题标题】:What's the best way to wait for a Form to be closed in MS Access VBA?在 MS Access VBA 中等待表单关闭的最佳方式是什么?
【发布时间】:2011-09-20 18:15:37
【问题描述】:

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

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

【问题讨论】:

    标签: forms ms-access vba wait


    【解决方案1】:

    当你发起DoCmd.OpenForm时设置WindowMode:=acDialog

    这是从其他 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
    

    否则:

    f.ShowDialog
    

    【讨论】:

    • 这让我找到了答案。我使用的是 DoCmd.OpenForm,所以我需要设置 WindowMode:=acDialog。如果您在答案中编辑此内容,我会接受。谢谢。
    • 这是一个格式非常糟糕的答案,因为第一行之后的所有内容都与 Access 完全无关。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-02-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多