Exiting access from Switchboard

  • Thread starter Thread starter milhil
  • Start date Start date
M

milhil

When I exit from switchboard it doesn't exit from Access.

I have tried to view codes design view of the switchboard , but couldn't
find any code like CloseCurrentDatabase. Any help please. Thanks.
 
CloseCurrentDatabase is located in HandleButtonClick()

The actual code is:
' Exit the application.
Case conCmdExitApplication
CloseCurrentDatabase

Change CloseCurrentDatabase to Quit

That will close the Access program as well as the database.
 
Thanks for the reply, but still confused. Couldn't find HandleButtonClick()
and where to edit the code is.
 
Open the switchboard in Design view. Click on View>Code. That will open the
code window. Put your cursor at the very top of the code page. Click on the
Right dropdown arrow and you will see a list of procedures. Select
HandleButtonClick. That will take you to the procedure. The 3 lines of code
I posted is near the bottom of the procedure.

--
Bill Mosca, MS Access MVP
http://www.thatlldoit.com
http://mvp.support.microsoft.com/profile/Bill.Mosca
http://tech.groups.yahoo.com/group/MS_Access_Professionals
 
Bill, I followed the steps and even selecting different Objects (other than
Form) and searching in the Procedure drop list I could see the Procedure
HandleButtonClick. The version I'm using is 2007. Thanks.
 
Bill,

When I try to type on the code window the one below, then on the Procedure
HandleButtonClick() apeared but doen't seem changed on the switchboard. It is
still won't close the application.

Private Function HandleButtonClick()
' Exit the application.
Case conCmdExitApplication
DoCmd.Quit
End Function
 
If you are using the new A2007 format then I don't believe the
built-in Switchboard has any VBA code, it uses only the new Macro
system.

If so then try this :-

Open the Switchboard form in Design mode.
Right click the button (called Option1) and display the Properties.
On the On Click property (shows as Embedded Macro) click the ...
button to display the Macro editor.
In the Condition column for the line that shows [Command =6] change
the entry in the Action column from CloseDatabase to Quit using the
drop down box.
Click in the Arguments column and change the entry to Prompt using the
drop down box at the bottom of the form.
Save the Macro and exit.
Save the Switchboard form and exit.

Let us know if it works, it may help other users.

HTH

Peter Hibbs.
 
Great, it works now. wow!!! As you said, it may help other users too.

Thank you Peter and I thank u also Bill and Karl.

Peter Hibbs said:
If you are using the new A2007 format then I don't believe the
built-in Switchboard has any VBA code, it uses only the new Macro
system.

If so then try this :-

Open the Switchboard form in Design mode.
Right click the button (called Option1) and display the Properties.
On the On Click property (shows as Embedded Macro) click the ...
button to display the Macro editor.
In the Condition column for the line that shows [Command =6] change
the entry in the Action column from CloseDatabase to Quit using the
drop down box.
Click in the Arguments column and change the entry to Prompt using the
drop down box at the bottom of the form.
Save the Macro and exit.
Save the Switchboard form and exit.

Let us know if it works, it may help other users.

HTH

Peter Hibbs.


Bill,

When I try to type on the code window the one below, then on the Procedure
HandleButtonClick() apeared but doen't seem changed on the switchboard. It is
still won't close the application.

Private Function HandleButtonClick()
' Exit the application.
Case conCmdExitApplication
DoCmd.Quit
End Function
 
Thanks for that, Peter. I didn't realize MS retooled the 2007 switchboard to
use macros.

--
Bill Mosca, MS Access MVP
http://www.thatlldoit.com
http://mvp.support.microsoft.com/profile/Bill.Mosca
http://tech.groups.yahoo.com/group/MS_Access_Professionals




Peter Hibbs said:
If you are using the new A2007 format then I don't believe the
built-in Switchboard has any VBA code, it uses only the new Macro
system.

If so then try this :-

Open the Switchboard form in Design mode.
Right click the button (called Option1) and display the Properties.
On the On Click property (shows as Embedded Macro) click the ...
button to display the Macro editor.
In the Condition column for the line that shows [Command =6] change
the entry in the Action column from CloseDatabase to Quit using the
drop down box.
Click in the Arguments column and change the entry to Prompt using the
drop down box at the bottom of the form.
Save the Macro and exit.
Save the Switchboard form and exit.

Let us know if it works, it may help other users.

HTH

Peter Hibbs.


Bill,

When I try to type on the code window the one below, then on the Procedure
HandleButtonClick() apeared but doen't seem changed on the switchboard. It
is
still won't close the application.

Private Function HandleButtonClick()
' Exit the application.
Case conCmdExitApplication
DoCmd.Quit
End Function
 
Bill,

Nor did I until I did a bit of digging. I think the moral of this post
is that when it comes to Access 2007, you cannot take ANYTHING for
granted.

Peter Hibbs.
 
Back
Top