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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

closing a form closes access 2

Status
Not open for further replies.

aw23

Programmer
Nov 26, 2003
544
IL
I would like access to close when a form is closed. How do I specify access to close from my code?
 
Here is your code:

Private Sub Form_Unload(Cancel As Integer)
If MsgBox("Are you sure you want to quit ?", vbQuestion + vbYesNo, "Confirm ...") = vbYes Then
DoCmd.Quit
Else
Cancel = True
End If
End Sub


Is that what you were looking for ?
 
You could also try
Application.Quit
instead of DoCmd.Quit

Hope this helps.

Fitz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top