473,387 Members | 1,512 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,387 software developers and data experts.

Force another Access App to quit

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
4 2432
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
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
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
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 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...
5
by: Stefania Scott | last post by:
I am trying to print a word document from Access. The code I've written works well in my computer but does not in the one were it is needed. Here the piece of code: 'doc path strObjectPath =...
4
by: Andrew Chanter | last post by:
I have a VB app that has a routine that runs macros in a (password protected) Access 97 db. (I have attached the code below.) Most of these macros end up opening a form in the Access db for the...
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: lauren quantrell | last post by:
In Access, is there a simple way to determine if another Access application is running and then force it to quit? Example App1 is running. It checks to see if App2 is running. If App2 is...
1
by: Steven Thomas | last post by:
I have a windows service that uses office xp automation. Here is the code --------------------------------------- Public Sub CAccessSnapShot() Try Dim objAccess As New Access.Application() Dim...
16
by: JoeW | last post by:
I'm utilizing a database that I created within MS Access within a program I've created in VB.NET. I am using the VB front end to navigate the information, but want to be able to print a report,...
4
by: sherifffruitfly | last post by:
Hi, I load the contents of an excel sheet into a dataset via the excel object library (couldn't get the #$%#$^ oledb/ado route to work - #^$%&^%$ connection strings... grrr.... ) Anyway,...
41
by: Twayne | last post by:
Hi, How would I go about "forcing" a user from one page to another? I have a very simple random question/answer entrance requirement for an e-mail form. After 3 page views most people are...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.