This is my solution to the problem where you want to pause your code until a form is closed down. While the acDialog option on DoEvents.OpenForm is great, you can't interact with the form before or after opening it, so there are some limitations to using that. Here is a subroutine that does the job whenever you want to call it.

Note that I am not a professional Access developer so if my error trapping code is not super duper perfect cool, I am sorry.

Public Sub WaitForFormToClose(FormName as String)
Dim Dummy As Long
On Error GoTo FormIsClosed
' this will cause an error only if the form has been unloaded
' until then, no error is triggered
Dummy = Access.Forms(FormName).Width
DoEvents ' make sure we don't bog the system down witing for the form to close
GoTo KeepWaiting

On Error GoTo 0
End Sub