By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,471 Members | 2,277 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,471 IT Pros & Developers. It's quick & easy.

Force another Access App to quit

P: n/a
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
Nov 12 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
la*************@hotmail.com (Lauren Quantrell) wrote:
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.


There's a means of detecting whether your app is already running and you don't want
to have multiple copies of the app running. It works by looking for the title among
all the open programs. (I don't recall the URL though as I don't currently have
web access.)

You should then be able to end the other program using some kind of API call.

I realize this is a bit vague so if anyone else wants to jump in with specific URLs
please do so.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Nov 12 '05 #2

P: n/a
On Apr 23 2004, 01:04 pm, Tony Toews <tt****@telusplanet.net> wrote in
news:e1********************************@4ax.com:
la*************@hotmail.com (Lauren Quantrell) wrote:
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.


There's a means of detecting whether your app is already running and
you don't want to have multiple copies of the app running. It works
by looking for the title among all the open programs. (I don't
recall the URL though as I don't currently have web access.)

You should then be able to end the other program using some kind of
API call.

I realize this is a bit vague so if anyone else wants to jump in with
specific URLs please do so.


I believe this is the link:
http://mvps.org/access/api/api0041.htm

However, it needs to be adapted slightly to achieve the OP's goal.

--
remove a 9 to reply by email
Nov 12 '05 #3

P: n/a
Dimitri,
Thanks for that code. I have seen some even shorter versions of this,
but all end up using application.quit to end the second instance of
the just opened app. Do you know how I do the equivalent of:
myAppName1.quit?

lq
Dimitri Furman <df*****@cloud99.net> wrote in message news:<Xn****************************@127.0.0.1>...
On Apr 23 2004, 01:04 pm, Tony Toews <tt****@telusplanet.net> wrote in
news:e1********************************@4ax.com:
la*************@hotmail.com (Lauren Quantrell) wrote:
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.


There's a means of detecting whether your app is already running and
you don't want to have multiple copies of the app running. It works
by looking for the title among all the open programs. (I don't
recall the URL though as I don't currently have web access.)

You should then be able to end the other program using some kind of
API call.

I realize this is a bit vague so if anyone else wants to jump in with
specific URLs please do so.


I believe this is the link:
http://mvps.org/access/api/api0041.htm

However, it needs to be adapted slightly to achieve the OP's goal.

Nov 12 '05 #4

P: n/a
On Apr 24 2004, 09:48 am, la*************@hotmail.com (Lauren Quantrell)
wrote in news:47**************************@posting.google.c om:
Dimitri,
Thanks for that code. I have seen some even shorter versions of this,
but all end up using application.quit to end the second instance of
the just opened app. Do you know how I do the equivalent of:
myAppName1.quit?


Quit is a method of the Application object. You create in instance of the
application by using CreateObject, or point to an existing instance by
using GetObject. Either one of those two methods will give you an object
variable of type Application, and you can invoke its Quit method.

If you don't want to do any of that, you still can close another Windows
application using an API call. The code is on the same site.

--
remove a 9 to reply by email
Nov 12 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.