add code exit the database when form is closed.

  • Thread starter Thread starter mon
  • Start date Start date
M

mon

Hi again, how do I adjust the below code to close the form
and exit the database? Thanks mon

Private Sub Command37_Click()
On Error GoTo Err_Command37_Click
DoCmd.Close
Exit_Command37_Click:
Exit Sub
Err_Command37_Click:
MsgBox Err.Description
Resume Exit_Command37_Click
End Sub
 
Application.Quit
will close the db for you.
You already have a DoCmd.Close
for the form, I take it. Is it not working?
 
Thanks Dan
Yes the form closes OK, but I want the whole thing to
close. Do I fit application.Quit into the Button Code
somewhere or does it have to go somewhere else?
Thanks Mon
 
Mon,

Try this...

DoCmd.Close acForm, Me.Name
DoCmd.Quit

- Steve Schapel, Microsoft Access MVP
 
Back
Top