Results 1 to 5 of 5
  1. #1
    slimjen is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    727

    exit

    I have an exit button on my switchboard in a database that exits only the database. How do I code it to exit Access too?

  2. #2
    Toyman is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    233
    Quote Originally Posted by slimjen View Post
    I have an exit button on my switchboard in a database that exits only the database. How do I code it to exit Access too?
    What is the code you have in the exit button. One simple code is:

    docmd.RunCommand acCmdExit

  3. #3
    slimjen is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    727
    Code:
    CmdExitApplication
                CloseCurrentDatabase
    I'll try the simple code.
    Thanks

  4. #4
    slimjen is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    727
    ok. I tried this. But it bypasses the "compact on close" I would like this to happen before closing the database.

  5. #5
    Toyman is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    233
    Quote Originally Posted by slimjen View Post
    ok. I tried this. But it bypasses the "compact on close" I would like this to happen before closing the database.
    Ref: "docmd.RunCommand acCmdExit"
    No, I just checked the code in my db running Access 2010 with the db option to "compact on close" checked. The exit code ran and the db got compacted.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. exit form using BeforeUpdate 'or' cmdButton
    By ConfusedMike in forum Forms
    Replies: 9
    Last Post: 09-21-2011, 10:05 PM
  2. How do I capture Access DB exit event
    By jscriptor09 in forum Access
    Replies: 3
    Last Post: 09-21-2011, 09:45 AM
  3. Emailing Last Record & exit handling
    By malamute20 in forum Programming
    Replies: 25
    Last Post: 08-24-2011, 05:14 AM
  4. Replies: 3
    Last Post: 08-08-2010, 05:33 PM
  5. Replies: 0
    Last Post: 05-17-2008, 01:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums