Yes/No MsgBox - Return to Form

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

Guest

I have a simple msgbox with vbYesNo for an "upon close" event. When Yes is clicked it closes the form, which is fine. But, when No is clicked I want it to return to the form instead of closing it. How do I do this?
 
I have a simple msgbox with vbYesNo for an "upon close" event. When Yes is clicked it closes the form, which is fine. But, when No is clicked I want it to return to the form instead of closing it. How do I do this?

The Close event is not the place to do this.
Use the Form's UnLoad event:

Cancel = MsgBox("Are you sure?",vbYesNo,"Closing Form") = vbNo
 
Thank you so much! It works great now.

fredg said:
The Close event is not the place to do this.
Use the Form's UnLoad event:

Cancel = MsgBox("Are you sure?",vbYesNo,"Closing Form") = vbNo
 
Back
Top