Switchboard Manager--Exit to Desktop

  • Thread starter Thread starter Ramona Goutiere
  • Start date Start date
R

Ramona Goutiere

I'm new to Access switchboards and have developed a basic switchboard for a
simple database using the Switchboard Manager. Users access my database
directly from the desktop using a shortcut which takes them to the
switchboard form. I would like to have an "Exit" button on the switchboard
form which takes users directly back to the desktop when they're finished.

The switchboard manager includes an exit option which closes the
application/database, but that isn't exactly what I had in mind.

How can I get the Exit option to take users directly back to the desktop? I
am running Windows XP Professional and Access 2002.

Any help will be sincerely appreciated. Thanks much!

Ramona
 
Hi Ramona,

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.
Hope that helps,
Jeff Conrad
Bend, Oregon
 
Jeff:

THANK YOU, THANK YOU, THANK YOU!!!

Both the code you suggested (and the code suggested by Dan Artuso--see
related post) worked like charms.

Your taking the time to share your expertise is appreciated more than you
know. I've put your note in my "Quick Fixes" folder for future use. It's a
nifty little trick.

I'm one happy camper. Thanks again for making my life so much
easier--because I didn't even know where to begin!!!

Ramona
 
Dan:

IT WORKED!!!

I tried both your code (and the code suggested by Jeff Conrad--see related
post) and they worked perfectly. There's always more than one way to do
things, and I didn't have a clue how to get there EITHER way until the two
of you shared.

Your thoughtfulness in responding is appreciated. I've saved the info in my
"Quick Fixes" folder because I'm sure I'll use it again. And again.

I love Microsoft newsgroups!

Ramona
 
Back
Top