Results 1 to 2 of 2
  1. #1
    KSP is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2014
    Posts
    1

    Getting DoCmd.Quit error when trying to trigger a function using a macro

    I have a macro called Abatemac call a funtion called TestFunction that calls a function called Abatement.
    I get an error message "'Quit' isn't available" using the DoCmd.Quit in the Abatement function. If I run the function directly the DoCmd.Quit executes with out a problem.

    If I add the Quit/Exit command to the Abatemac macro I get the below error message:

    The Command or action ‘Quit’ isn’t available now.


    * You may be in a read-only database or an unconverted database from an earlier version of Microsoft Office Access
    *The type of object the action applies to isn’t currently select or isn’t in the active view.
    Do I have to add a reference to use the quit command? Why would the system give me the option to use command and then say it is unavailable?

  2. #2
    drexasaurus's Avatar
    drexasaurus is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Location
    Santa Ana, CA
    Posts
    60
    This is just a shot in the dark, but are you possibly editing any data before calling the quit function? It seems to me the sort of thing Access would do, to try to save the open data before closing out. Any open recordsets with non-cancelled edits as well? You can explicitly mark the function to save or not save data first as well I think.

    I googled just now because I was curious. I read somewhere that running DoCmd.CloseDatabase before calling .Quit will help alleviate this issue.

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

Similar Threads

  1. Replies: 6
    Last Post: 06-07-2014, 04:42 AM
  2. Query running on DoCmd.Quit?
    By ts_hunter in forum Access
    Replies: 2
    Last Post: 02-06-2014, 10:16 AM
  3. Replies: 8
    Last Post: 06-27-2013, 11:58 AM
  4. Cancel button in Quit Macro
    By ashu.doc in forum Forms
    Replies: 3
    Last Post: 09-19-2012, 04:40 PM
  5. Macro to trigger emailing an updateable table
    By KOIBOY in forum Import/Export Data
    Replies: 5
    Last Post: 09-10-2011, 05:46 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