Solved

DoCmd.Quit Very Slow

Posted on 2008-06-09
10
592 Views
Last Modified: 2012-06-27
I have a quit button on a form, the event for onclick calls DoCmd.Quit. It takes about 45 seconds for access to close once this button is pressed.

How can I fix this?
0
Comment
Question by:bejhan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 75
ID: 21745294
Is there any code or process running prior to the Quit command - such that Access would have to wait?

mx
0
 
LVL 1

Author Comment

by:bejhan
ID: 21745363
Nothing at all. And there are other buttons to open other forms and close the current form and pressing those buttons opens the forms quickly. So if access had to wait those would take long as well right?
0
 
LVL 65

Accepted Solution

by:
Jim Horn earned 100 total points
ID: 21745582
Give this a whirl...

DoCmd.Quit acQuitSaveNone

This assumes that there are no updates pending that you care about when code hits this line
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 75
ID: 21745605
Before you close ... open Task Manager, select the Process tab ... and see is Access is eating up resources during this long close.

mx
0
 
LVL 1

Author Comment

by:bejhan
ID: 21745692
DoCmd.Quit acQuitSaveNone worked like a charm. I'm not quite sure what is saved at this time. For example what if a process I ran modified some tables etc. Would these changes be saved at the DoCmd.Quit or at the time of the process end? Because I wouldn't want to lose those changes.

During the long close access fluctuates between 1-9% of CPU and about 20,000K mem usage, so nothing too crazy.
0
 
LVL 8

Expert Comment

by:Emil_Gray
ID: 21745733
I would suggest using the following.

DoEvents
DoCmd.Quit acQuitSaveNone

to ensure all of your updates are completed before quitting the application.
0
 
LVL 75
ID: 21745764
Just an fyi ... DoEvents allows Windows to 'update' other screen things - not Access updates per se.

mx
0
 
LVL 1

Author Comment

by:bejhan
ID: 21747018
So what is saved at the time of DoCmd.Quit. Is it all table changes made throughout the running of the app?
0
 
LVL 75
ID: 21747156
From Help:

Setting
The Quit action has the following argument.

Action argument Description
Options Specifies what happens to unsaved objects when you quit Access. Click Prompt (to display dialog boxes that ask whether to save each object), Save All (to save all objects without prompting by dialog boxes), or Exit (to quit without saving any objects) in the Options box in the Action Arguments section of the Macro window. The default is Save All.

mx
0
 
LVL 15

Expert Comment

by:cquinn
ID: 21750511
It will also be slower if you have set the database to compact on exit
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question