473,412 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

docmd.quit vs. Application.Quit

Just noticed something interesting in the above. If you have your program
file set to "Compact on Close" in access 2007 (which is desirable when you
have a larger program that frequently needs compacting), if you use the
following code on an "Exit Application" type button, the compacting on close
won't fire:

Application.Quit acQuitSaveNone

however, if you use:

Docmd.Quit

Then the compacting on close does fire.

Has anyone else seen this? Any dangers with docmd.quit, or is
application.quit just a preferred method?

Many Thanks,

Oct 29 '08 #1
9 21333
"Andy" <PC*****@PCESoft.invalidwrote in message
news:Ma*****************@nlpi065.nbdc.sbc.com...
Just noticed something interesting in the above. If you have your program
file set to "Compact on Close" in access 2007 (which is desirable when you
have a larger program that frequently needs compacting), if you use the
following code on an "Exit Application" type button, the compacting on
close won't fire:

Application.Quit acQuitSaveNone

however, if you use:

Docmd.Quit

Then the compacting on close does fire.

Has anyone else seen this? Any dangers with docmd.quit, or is
application.quit just a preferred method?
For me, compact on close is not a required option because I have my apps set
up such that a new, pristine front end file is delivered to the user's PC
with every new session. As far as I can tell, compact on close is only ever
any use when you have a single file single user application. There are
issues with the DoCmd.Quit method although, off the top of my head I can't
remember what they are. What I do remember is recently going through all of
my apps and replacing every instance with Application.Quit. But if your app
is of the single file single user nature (ie only you use it) then I
wouldn't lose too much sleep about using DoCmd.Quit.

Keith.
www.keithwilby.co.uk

Oct 30 '08 #2
Thanks for the reply, Keith.

It's a front end / back end runtime app. People have posted before against
using the compact on close, but in my testing, you're really talking about
only compacting the front end on close, it won't do anything to the back
end, so I'm leaning towards 'compacting on close' being a great thing (see
my new post from a few minutes ago)...

Take care,

"Keith Wilby" <he**@there.comwrote in message
news:49********@glkas0286.greenlnk.net...
"Andy" <PC*****@PCESoft.invalidwrote in message
news:Ma*****************@nlpi065.nbdc.sbc.com...
>Just noticed something interesting in the above. If you have your program
file set to "Compact on Close" in access 2007 (which is desirable when
you have a larger program that frequently needs compacting), if you use
the following code on an "Exit Application" type button, the compacting
on close won't fire:

Application.Quit acQuitSaveNone

however, if you use:

Docmd.Quit

Then the compacting on close does fire.

Has anyone else seen this? Any dangers with docmd.quit, or is
application.quit just a preferred method?

For me, compact on close is not a required option because I have my apps
set up such that a new, pristine front end file is delivered to the user's
PC with every new session. As far as I can tell, compact on close is only
ever any use when you have a single file single user application. There
are issues with the DoCmd.Quit method although, off the top of my head I
can't remember what they are. What I do remember is recently going
through all of my apps and replacing every instance with Application.Quit.
But if your app is of the single file single user nature (ie only you use
it) then I wouldn't lose too much sleep about using DoCmd.Quit.

Keith.
www.keithwilby.co.uk
Oct 30 '08 #3
Keith Wilby wrote:
"Andy" <PC*****@PCESoft.invalidwrote in message
news:Ma*****************@nlpi065.nbdc.sbc.com...
>Just noticed something interesting in the above. If you have your
program file set to "Compact on Close" in access 2007 (which is
desirable when you have a larger program that frequently needs
compacting), if you use the following code on an "Exit Application"
type button, the compacting on close won't fire:

Application.Quit acQuitSaveNone

however, if you use:

Docmd.Quit

Then the compacting on close does fire.

Has anyone else seen this? Any dangers with docmd.quit, or is
application.quit just a preferred method?

For me, compact on close is not a required option because I have my apps
set up such that a new, pristine front end file is delivered to the
user's PC with every new session.
What happens when a user attempts to open 2 sessions of the application?

As far as I can tell, compact on
close is only ever any use when you have a single file single user
application. There are issues with the DoCmd.Quit method although, off
the top of my head I can't remember what they are. What I do remember
is recently going through all of my apps and replacing every instance
with Application.Quit. But if your app is of the single file single
user nature (ie only you use it) then I wouldn't lose too much sleep
about using DoCmd.Quit.
If one compacts on close, isn't the compact on the FE? Again, I'd think
this could be a problem if you had 2 or more sessions open.
>
Keith.
www.keithwilby.co.uk
Oct 30 '08 #4
"Salad" <oi*@vinegar.comwrote in message
news:YM******************************@earthlink.co m...
Keith Wilby wrote:
>>
For me, compact on close is not a required option because I have my apps
set up such that a new, pristine front end file is delivered to the
user's PC with every new session.

What happens when a user attempts to open 2 sessions of the application?
A good question but it's a scenario I've never encountered. I suspect that
it will be the same as 2 users sharing a FE file on a server. In the 10 or
so years I've been using that setup I've never had any problems with it.
Would you recommend a different approach or even having code to mitigate for
that possibility?

Keith.

Oct 30 '08 #5
Using full access, you can open 2 instances of the same program (which I've
done by mistake many times). But using the runtime, you can't open a second
instance of the same mde/accde file.
"Keith Wilby" <he**@there.comwrote in message
news:49**********@glkas0286.greenlnk.net...
"Salad" <oi*@vinegar.comwrote in message
news:YM******************************@earthlink.co m...
>Keith Wilby wrote:
>>>
For me, compact on close is not a required option because I have my apps
set up such that a new, pristine front end file is delivered to the
user's PC with every new session.

What happens when a user attempts to open 2 sessions of the application?

A good question but it's a scenario I've never encountered. I suspect
that it will be the same as 2 users sharing a FE file on a server. In the
10 or so years I've been using that setup I've never had any problems with
it. Would you recommend a different approach or even having code to
mitigate for that possibility?

Keith.
Oct 30 '08 #6
Keith Wilby wrote:
"Salad" <oi*@vinegar.comwrote in message
news:YM******************************@earthlink.co m...
>Keith Wilby wrote:
>>>
For me, compact on close is not a required option because I have my
apps set up such that a new, pristine front end file is delivered to
the user's PC with every new session.


What happens when a user attempts to open 2 sessions of the application?

A good question but it's a scenario I've never encountered. I suspect
that it will be the same as 2 users sharing a FE file on a server. In
the 10 or so years I've been using that setup I've never had any
problems with it. Would you recommend a different approach or even
having code to mitigate for that possibility?
I probably would use some code to enumerate the class/caption of open
windows http://www.mvps.org/access/api/api0013.htm. If one exists I
know a session of the app is open and would not copy over another copy
of the app.
Keith.
Oct 30 '08 #7
Andy wrote:
Using full access, you can open 2 instances of the same program (which
I've done by mistake many times). But using the runtime, you can't open
a second instance of the same mde/accde file.
My users of A2003 don't have that problem. They can open up multiple
instances of the app with an MDE using the runtime. Maybe it's a 2007
thing.

>

"Keith Wilby" <he**@there.comwrote in message
news:49**********@glkas0286.greenlnk.net...
>"Salad" <oi*@vinegar.comwrote in message
news:YM******************************@earthlink.c om...
>>Keith Wilby wrote:
For me, compact on close is not a required option because I have my
apps set up such that a new, pristine front end file is delivered to
the user's PC with every new session.
What happens when a user attempts to open 2 sessions of the application?

A good question but it's a scenario I've never encountered. I suspect
that it will be the same as 2 users sharing a FE file on a server. In
the 10 or so years I've been using that setup I've never had any
problems with it. Would you recommend a different approach or even
having code to mitigate for that possibility?

Keith.

Oct 30 '08 #8
I use the sagekey script, so maybe it's opening as exclusive using their
shortcuts, etc.
"Salad" <oi*@vinegar.comwrote in message
news:WL******************************@earthlink.co m...
Andy wrote:
>Using full access, you can open 2 instances of the same program (which
I've done by mistake many times). But using the runtime, you can't open a
second instance of the same mde/accde file.

My users of A2003 don't have that problem. They can open up multiple
instances of the app with an MDE using the runtime. Maybe it's a 2007
thing.

>>

"Keith Wilby" <he**@there.comwrote in message
news:49**********@glkas0286.greenlnk.net...
>>"Salad" <oi*@vinegar.comwrote in message
news:YM******************************@earthlink. com...

Keith Wilby wrote:

>
For me, compact on close is not a required option because I have my
apps set up such that a new, pristine front end file is delivered to
the user's PC with every new session.
What happens when a user attempts to open 2 sessions of the
application?
A good question but it's a scenario I've never encountered. I suspect
that it will be the same as 2 users sharing a FE file on a server. In
the 10 or so years I've been using that setup I've never had any
problems with it. Would you recommend a different approach or even
having code to mitigate for that possibility?

Keith.
Oct 30 '08 #9
"Salad" <oi*@vinegar.comwrote in message
news:p8******************************@earthlink.co m...
Keith Wilby wrote:
>"Salad" <oi*@vinegar.comwrote in message
news:YM******************************@earthlink.c om...
>>Keith Wilby wrote:
For me, compact on close is not a required option because I have my
apps set up such that a new, pristine front end file is delivered to
the user's PC with every new session.
What happens when a user attempts to open 2 sessions of the application?

A good question but it's a scenario I've never encountered. I suspect
that it will be the same as 2 users sharing a FE file on a server. In
the 10 or so years I've been using that setup I've never had any problems
with it. Would you recommend a different approach or even having code to
mitigate for that possibility?
I probably would use some code to enumerate the class/caption of open
windows http://www.mvps.org/access/api/api0013.htm. If one exists I know
a session of the app is open and would not copy over another copy of the
app.
Thanks Salad.

Oct 31 '08 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: David Conorozzo | last post by:
I create a new Access.Application instance. As soon as I refernce the property "References", I am unable to issue a truly successful quit on that instance. By that I mean the call to quit is fine...
3
by: jj | last post by:
I've got a form button that fires off 3 queries but if the first query returns an error, I don't want the other two queries to happen. Example: first query runs an insert from a linked table but...
4
by: Lauren Quantrell | last post by:
If an Access2K ade is running, say it's named app1.ade, and I open app2.ade, I want app2.ade to determine if app1.ade is running, and if it is, I want app2.ade to close app1.ade. Is this easy? lq
0
by: Robert Langen | last post by:
I'm calling an Access XP application from an Outlook XP appointment form. Everything works, but the lines DoCmd.OutputTo acOutputReport, "testreport", acFormatRTF, "c:\test.rtf", False Docmd.Quit...
6
by: beowulfs | last post by:
Here's what I've got: I've got a form with combo boxes. you can select already existing company names or type in new ones. if you type in a new one, it prompts you to double click the combo...
6
by: Max | last post by:
I have the following code on a form that launches Microsoft Outlook and creates a new email message for the user: Outlook.Application oApp = new Outlook.Application(); Outlook.MailItem oMail...
0
by: Alan T | last post by:
I tried to close the word document object and word application: private Interop.Word.Application WordApp; private Interop.Word.Document WordDoc; // close word and quit word application ...
0
by: Alan T | last post by:
private Interop.Word.Application _mergeWordApp; I tried to quit the Word application: _mergeWordApp.Application.Quit(ref _notTrue, ref _newMissing, ref _newMissing); However, I got...
2
by: Alan T | last post by:
private Interop.Word.Application _wordApp; What is the differences betwenn _wordApp.Quit(...) and _wordApp.Application.Quit(...) ?
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.