Sub OpenFormAndWait()
' Open the form in dialog mode
DoCmd.OpenForm "YourFormName", WindowMode:=acDialog
' Code here will execute after the form is closed
MsgBox "The form has been closed. Continuing with the code..."
End Sub
from copilot help
Keep document that easy to find
Sub OpenFormAndWait()
' Open the form in dialog mode
DoCmd.OpenForm "YourFormName", WindowMode:=acDialog
' Code here will execute after the form is closed
MsgBox "The form has been closed. Continuing with the code..."
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) Dim intAltDown As Integer intAltDown = (Shift And acAltMask) > 0 Select Case KeyCode Case vbKeyF4 If intAltDown Then KeyCode = 0 MsgBox "Alt+F4 has beed Disabled.", vbExclamation + vbOKOnly, " Disabled Key" End If End Select End Sub