Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    Sep 2004
    Location
    St. Louis, Missouri, USA
    Posts
    83
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Close Access from macro (Office 2003/Windows XP)

    Hi,
    Hans - are you there? Or anyone really - do you know if I can tell Access to close itself from within a macro? I have tried the Exit command thinking that would do it, but unfortunately it hasn't worked yet.
    Thanks,

    Lana

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Close Access from macro (Office 2003/Windows XP)

    The Quit action will close Access. This action has one argument in which you can specify whether objects with unsaved design changes should be saved. The options are:
    - Save all design changes.
    - Prompt the user.
    - Don't save any design changes.
    Note: this argument does not apply to changes in records. If the user has a table, query or form open with unsaved changes in a record, the record will be saved automatically irrespective of the above setting.

  3. #3
    Star Lounger
    Join Date
    Sep 2004
    Location
    St. Louis, Missouri, USA
    Posts
    83
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Close Access from macro (Office 2003/Windows XP)

    Hi Hans, Thanks for the quick reply. I must be doing something wrong. I am simply selecting commands etc. in the Macro function within my database. The last two actions are Run Command - Close to close the database and Quit - Exit to close Access, but it doesn't close. When I choose Quit, I have three options (Save All, Prompt and Exit). Is there another way or something else I should be doing? (It's not the end of the world, of course, I can always click the X myself.)
    Thanks,
    Lana

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Close Access from macro (Office 2003/Windows XP)

    Try omitting the RunCommand - Close action. I suspect that macro execution finishes the moment the database is closed, so the Quit action is never reached.

  5. #5
    Star Lounger
    Join Date
    Sep 2004
    Location
    St. Louis, Missouri, USA
    Posts
    83
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Close Access from macro (Office 2003/Windows XP)

    Hi again,
    You're right, of course. I realized that as soon as a took a break from it. I was closing the database with the macro in it and expecting the macro to keep on running - how silly is that! Thanks a lot - it's working fine now.
    Lana

Posting Permissions

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