Exit or Quit Access from Switchboard

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Seeking the code, tool or trick to have a "Quit" option on my Main
Switchboard that will close the database AND Access Aplication itself, taking
me all the way back to my Windows XP desktop. ...Thanks
 
Hi,

I don't recall if it was inspiration or following an example given but for
my &Quit Application button I go to a form which is invisible and which has
some cleanup code to close possibly open objects and then does
Application.Quit

HTH
 
hi
I use this:
Private Sub cmdExit_Click()

If MsgBox("This action will close Access. Do you still
wish to continue?", vbYesNo, "Exit Application Warning") =
vbYes Then
DoCmd.Close acForm, "frmMainIntro", acSaveYes
DoCmd.Close acDefault, "MDB40.mdb", acSaveYes
DoCmd.Quit acQuitSaveNone
Else
MsgBox ("Exit Application Action Aborted.")
End If

End Sub
 
in the switchboard manager...there are command controls for "quit
application" build a new control button using this...it works just fine..
 
Are you using the built-in Access Switchboard Manager?
And you want to have to have an option that closes all of Access instead of just the database?

If so, this is easy to do but first make a back-up copy of your database in case we screw up.

1. Open the Switchboard form in Design View.
2. Go to the code window for this form.
3. Go down to this area:

Private Function HandleButtonClick(intBtn As Integer)

Then look for this bit of code:

' Exit the application.
Case conCmdExitApplication
CloseCurrentDatabase

Change that code to this:

' Exit the application.
Case conCmdExitApplication
DoCmd.Quit

4. Compile the code and save the form.

5. Use the Switchboard Manager to create an option on your main page for
exiting. Select the command option that says "Exit Application." Press that
option on the form in normal view and it should close the database and
Access as well.

That should do it.
 
Thanks Jeff,
This answer got right to the basics to provide the solution. Good
response...Works great....many many thanks
 

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

Similar Threads


Back
Top