Assuming you used the standard switchboard template:
Can you get to your database window, where there are tabs for the tables,
queries, forms, etc?
Highlight the Switchboard form and select Design. Open the properties
window, Event, and open the code window for On Current.
Also in the same module as the On current code is a Private Function
HandleButtonClick(intBtn As Integer)
This should have your close application code; mine uses:
.......
Const conCmdExitApplication = 6
..........
Select Case rs![Command]
.......
' Exit the application.
Case conCmdExitApplication
CloseCurrentDatabase
.......
End Select
When I click this button the database closes but NOT the application.
In another database I use
DoCmd.Quit
Which closes the database and MS Access.
Mich
hparker said:
I tried this myself and it worked just fine, however, I now cannot edit
this
switchboard form because it apparently closes the for to open in design
mode,
but as it closes, well....the application quits. Any thoughts on how
to
fix
this? I'm stumped.
:
Rather than putting the code to quit Access in the button's Click
event
procedure, put it in the switchboard form's Close event procedure:
Application.Quit
This will ensure that the Access is closed however the user closes the
database, e.g. from the menu bar, rather than just from the command
button.
This assumes that the switchboard form remains open, even if hidden,
while
the database is open of course.
Ken Sheridan
Stafford, England
:
I have a Close button on my switchboard that (surprise, suprise)
shuts
my
database.
This leaves the main Access screen open, with just the toolbar at
the
top
and a full-sized empty grey screen.
We would much prefer it that when users close the mdb, Access would
be
closed completely too.
I guess it's just a case of adding something to the code for the
switchboard
Close command, and I tried quit.application but no good. So help me
please...
Thanks
CW