Overall Access "Close" Button

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!
 
D

Douglas J. Steele

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
 
W

WireGuy

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top