?
Solved

How to make sure only one process running?

Posted on 2003-03-20
3
Medium Priority
?
145 Views
Last Modified: 2010-04-07
I have a application, and I don't want user to start the same program with two instance.
How do I detect there is a instance already running?
0
Comment
Question by:chpchai
[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
3 Comments
 
LVL 26

Accepted Solution

by:
EDDYKT earned 60 total points
ID: 8173951
Private Sub Form_Load()
If App.PrevInstance Then End
End Sub
0
 

Author Comment

by:chpchai
ID: 8175559
How to terminate the program then?
0
 
LVL 1

Expert Comment

by:LordSkitch
ID: 8175588
app.previnstance checks to see if itself is running, then if it is, end kills it

if   app.previnstance   then   end
if (program is running) then (quit)
0

Featured Post

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!

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

777 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