PC Review


Reply
Thread Tools Rate Thread

closing the application with the switchboard exit

 
 
=?Utf-8?B?aGVscCE=?=
Guest
Posts: n/a
 
      25th Jan 2005
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!
 
Reply With Quote
 
 
 
 
Guest
Posts: n/a
 
      25th Jan 2005
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
>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!
>.
>

 
Reply With Quote
 
 
 
 
Jeff Conrad
Guest
Posts: n/a
 
      25th Jan 2005
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.

--
Jeff Conrad
Access Junkie
Bend, Oregon

"help!" <(E-Mail Removed)> wrote in message
news:12493DCF-3969-41A4-822C-(E-Mail Removed)...
> 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!



 
Reply With Quote
 
New Member
Join Date: Jun 2012
Location: Des Moines, Iowa
Posts: 4
 
      29th Jun 2012
thank you jeff for these instructions...you're a genius sir
although you should know that with access 2010, if you create a switchboard with switchboard manager, you would first have to convert all macros to VB and then you'll be able to view the switchboard's code....thanks once again
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Application.Exit() vs Environmrnt.Exit(0) =?Utf-8?B?VGFvZ2U=?= Microsoft C# .NET 1 19th Apr 2007 03:37 AM
application.exit, application.exitthread exit application problem =?Utf-8?B?TWlrZSBTaWx2ZXI=?= Microsoft Dot NET Framework Forms 2 24th Nov 2004 04:14 AM
Why won't Application.Exit() exit the application? Mark Cranness Microsoft Dot NET Framework Forms 3 12th Mar 2004 05:15 PM
Application.exit() vs Environment.exit(-1) vs Application.exitthread() Brendan Miller Microsoft C# .NET 1 5th Feb 2004 09:13 AM
Switchboard Form - Exit application Marie Microsoft Access Form Coding 1 6th Jan 2004 04:49 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:59 AM.