Hi,
Unfortunately there is not a straight forward way to do this. So far I can only think of two approaches, neither of which may be ideal.
First is to enter some type of a loop after you display the instance of the form that waits for it to close. Something like:
While (CurrentProject.AllForms("frmMyDialog").IsLoaded )
DoEvents
Wend
If you are managing multiple instances however, this approach might not work until each instance of the form is closed.
If possible, a cleaner approach might be to move the code that should execute after the form is closed into a separate routine and call this code from the Close event of the form in question.
Hope this helps,
Rob Cooper
Lead Software Design Engineer in Test
Microsoft Access Team
co-author: Access 2007 VBA Programmer's Reference
co-author: Expert Access 2007 Programming
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at microsoft.com/info/cpyright.htm.
|