Overall Access "Close" Button

  • Thread starter Thread starter WireGuy
  • Start date Start date
W

WireGuy

How can I avoid users from using the upper most close "X" button? or if they
click it, I'd like to open a form to confirm they actually want to leave
access all together. They are accidently clicking the upper close and must
re-open to complete the task.

I have controls on the switch board screen that I can ask "are you sure",
but the overall Access "Close" is still available for their use and I don't
know how to control or add controls to this option.

Thanks for the help!
 
Have a form that's always open (even if it's not visible). In that form's
Unload event, put code that prompts the user:

Private Sub Form_Unload(Cancel As Integer)

If MsgBox("Do you want to leave Access?", vbYesNo) = vbNo Then
Cancel = True
End If

End Sub
 
Thank you Douglas, this works great! I appreciate your help! Simple yet
highly effective!
 
Back
Top