cancel event

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi:

I included a SendEmail event in the OnClose of a Main Form. I have Cancel
cmdbutton in the form in case the user doesn't want to proceeed. How can I
bypass the Onclose event? Thanks.
 
You can cancel the Unload event, but not the Close event of the form. In the
form's Unload event, if you enter the line

Cancel = True

the form won't close.
 
Thanks for the prompt response.
What I want to do is to cancel the event that is incorporated in the OnClose
event of the Form. That is, if certain criteria was not met the codes will
not be executed.
 
In that case use an If...Then statement before the code.

If Criteria = Whatever Then
'Execute your code here
End If
 
So simple. Thanks again.
--
Allan


Wayne Morgan said:
In that case use an If...Then statement before the code.

If Criteria = Whatever Then
'Execute your code here
End If
 
Back
Top