Dim bStop As Boolean
Private Sub Command1_Click()
Text1.Text = (Val(Text1.Text) + 1) Mod 30000
If bStop Then
bStop = False
Private Sub Command2_Click()
bStop = True
Open in new window
DoCmd.OpenForm "frmTest", , , , , acDialog
If CurrentProject.AllForms("frmTest").IsLoaded Then
DoCmd.Close acForm, "frmTest"
Debug.Print "Code continues after form has closed"
Private Sub cmdCloseHide_Click()
'This command doesn't actually close the form, it hides it.
'If the form was called from another procedure as a dialog form (modal) then
'Code from the calling procedure would halt until this form was closed or hidden.
'By hiding it instead of closing it we give the calling procedure the option to decide
'how to proceed.
Me.Visible = False
The revolutionary project management tool is here! Plan visually with a single glance and make sure your projects get done.