M
MAB
In the following code, when the variable MarkUpValue is equal to -1, I want
to close the form and exit the sub routine for the cmdConfirm_Click() event.
However, it just seems to conveniently forget to exit the sub, and continues
to execute the code below the End If statement. Of course, the code down
there requires that the form be open (but it was closed because MarkUpValue
= -1). This results in a error, since the code below requires that the form
be open to function. I can't figure out why the form closes when the
variable = -1, but the execution of the code continues. Any ideas?
Private Sub cmdConfirm_Click()
If MarkUpValue = -1 Then
DoCmd.Close
Exit Sub
End If
....other code down here...
End Sub
to close the form and exit the sub routine for the cmdConfirm_Click() event.
However, it just seems to conveniently forget to exit the sub, and continues
to execute the code below the End If statement. Of course, the code down
there requires that the form be open (but it was closed because MarkUpValue
= -1). This results in a error, since the code below requires that the form
be open to function. I can't figure out why the form closes when the
variable = -1, but the execution of the code continues. Any ideas?
Private Sub cmdConfirm_Click()
If MarkUpValue = -1 Then
DoCmd.Close
Exit Sub
End If
....other code down here...
End Sub