G
Guest
Hi everyone,
I am trying to set some conditions in my form unload procedure in case a
user tries to close the form before some validation is performed.
(closingprocures is a function which validates)
Here is my code:
DoCmd.CancelEvent
If (ClosingProcedures = False) Then
Exit Sub
Else
DoCmd.Close acForm, Me.Name
End If
So, what happens is the form closes, which it shouldn't
then it gives me an error at the close form line, error 2501, The close
action was cancelled.
Does anyone know how to accomplish this?
Thanks in advanced,
I am trying to set some conditions in my form unload procedure in case a
user tries to close the form before some validation is performed.
(closingprocures is a function which validates)
Here is my code:
DoCmd.CancelEvent
If (ClosingProcedures = False) Then
Exit Sub
Else
DoCmd.Close acForm, Me.Name
End If
So, what happens is the form closes, which it shouldn't
then it gives me an error at the close form line, error 2501, The close
action was cancelled.
Does anyone know how to accomplish this?
Thanks in advanced,