Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Confirm close when clicking the close button

Status
Not open for further replies.

btaber

Programmer
May 26, 2002
307
US
When the user clicks the close button on the man access window, I would like to ask the user "Are you sure you want to exit", with a yes no msg box, and if no is clicked, keep access open, and if yes, exit access. I have found methods to disable the close buttons, but it is too confusing for users used to using the X button. Is this possible? I have seen it before in regular VB...
 
This should do the trick:

Private Sub Form_Unload(Cancel As Integer)
Dim Rply
Rply= MsgBox("Are You shre U want etc etc.", vbYesNo, "Your App")
If Svar = IDYES Then DoCmd.Quit Else Cancel = True
End Sub
 
I wish it was that easy, but I need it for the database, not the forms...
 
same principle.
set the code in your startup form
or else; make an invincible form. when you close the app. you unload this form.
 
That was too easy, I have been looking for this for days, Thanks!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top