What is the best way to wait for a form to close in MS Access VBA?

I am invoking a form from a module and would like to wait for the form to complete before the rest of the module completes. What is the correct way to wait?

I have an IsOpen ("formname") function to check if the form remains open.

+5
source share
1 answer

set WindowMode:=acDialogwhen you initiateDoCmd.OpenForm

Here's how to do it from other Office VBA (Excel, Word, VB6, VB.Net) Call a form using the following code

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

Otherwise:

f.ShowDialog
+5
source

All Articles