Results 1 to 9 of 9

Thread: Exiting Access

  1. #1
    frmorris
    Guest

    Exiting Access

    How do you get the Exit button on a switchboard to exit completly out of Access? My exit button now, will exit out of my database, but it does not close Access.

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Exiting Access

    Hi,
    If you change the code behind the button to Application.Quit it should completely close down Access.
    Hope that helps.
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Exiting Access

    That doesn't always work if there are objects still open in the database. Make sure you don't have any hidden forms still open.
    Charlotte

  4. #4
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Exiting Access

    I thought the default option for Quit was acSaveYes which (allegedly) saves everything without prompting and then shuts down Access. Is that not the case in practice?
    Regards,
    Rory

    Microsoft MVP - Excel

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Exiting Access

    It doesn't always terminate the Access process. If you use the compatibility library, it works, but that isn't the world's best programming and is inadvisable for other reasons. If you use the current libraries and set a form's visible property to false before you quit, the database may close; but you'll see the Access application minimized on the taskbar because an object was left open.
    Charlotte

  6. #6
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Exiting Access

    That's useful to know - thanks, Charlotte.
    Regards,
    Rory

    Microsoft MVP - Excel

  7. #7
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Exiting Access

    Just so you know, the same problem can occur if you create object variables in code and don't destroy them. I make it a rule when I dim object variables to go to the bottom of the routine immediately and put in the code to set them to nothing.
    Charlotte

  8. #8
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Youngstown, Ohio, USA
    Posts
    705
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Exiting Access

    Instead of using the "Exit Application" switchboard command, I set the command to run a "quitter" macro instead. This macro contains one command only - Quit, with the option set to Exit. Click the button, and Access will close completely.

  9. #9
    frmorris
    Guest

    Re: Exiting Access

    Thanks, your suggestion did help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •