Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

DoCmd.Quit Very Slow

Posted on 2008-06-09
10
Medium Priority
?
600 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 66

Accepted Solution

by:
Jim Horn earned 400 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
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

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

636 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