Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / January 2005

Tip: Looking for answers? Try searching our database.

closing the application with the switchboard exit

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
help! - 25 Jan 2005 19:15 GMT
When I use the exit on the switchboard it closes the database but leaves the
Access application open. Is there anything  I can do to click the exit button
and have the Access close too and return to the desktop?

thanks!
anonymous@discussions.microsoft.com - 25 Jan 2005 19:46 GMT
yes,
the button as is now probably has something like this
DoCmd.Close acForm, "FormName"
change it to
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, "db.mdb", acSaveYes
       DoCmd.Quit acQuitSaveNone
       Else
       MsgBox ("Exit Application Action Aborted.")
   End If

End Sub
>-----Original Message-----
>When I use the exit on the switchboard it closes the database but leaves the
[quoted text clipped - 3 lines]
>thanks!
>.
Jeff Conrad - 25 Jan 2005 19:46 GMT
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 (if you have not already). 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.

Signature

Jeff Conrad
Access Junkie
Bend, Oregon

> When I use the exit on the switchboard it closes the database but leaves the
> Access application open. Is there anything  I can do to click the exit button
> and have the Access close too and return to the desktop?
>
> thanks!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.