Exiting Access programatically?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can Access be closed programatically in VBA? I have an "Exit Application" command button on my main switchboard which closes the application but leaves Access open. Can I add some code to also Exit Access
ctda
 
Can Access be closed programatically in VBA? I have an "Exit Application"
command button on my main switchboard which closes the application but leaves
Access open. Can I add some code to also Exit Access?

The following command will cause Access to close the open database *and* quit
the application:

DoCmd.Quit

In order to make this work with your switchboard, you may want to modify the
"HandleButtonClick" function in the code module behind the switchboard form. You
will need to locate the section in the "Select Case" structure that reads:

Case conCmdExitApplication

Under that section, comment out the line that reads "CloseCurrentDatabase" and
insert, below it, the "DoCmd.Quit" command described above.
 
Thanks. That does it. I didn't realize there was one simple command to do this
ctda

----- Bruce M. Thompson wrote: ----
Can Access be closed programatically in VBA? I have an "Exit Application
command button on my main switchboard which closes the application but leave
Access open. Can I add some code to also Exit Access

The following command will cause Access to close the open database *and* qui
the application

DoCmd.Qui

In order to make this work with your switchboard, you may want to modify th
"HandleButtonClick" function in the code module behind the switchboard form. Yo
will need to locate the section in the "Select Case" structure that reads

Case conCmdExitApplicatio

Under that section, comment out the line that reads "CloseCurrentDatabase" an
insert, below it, the "DoCmd.Quit" command described above
 
Back
Top