Run Program Once
Hi,
How can I make sure that my application can run only once if it's already in use? (meaning: if the user already start using the application, and the application was minimized, then another user try to run the application again, the last user must received either error message or the application become maximized).
Please help!
Thank you,
[359 byte] By [
moe188] at [2007-11-11 6:59:04]

# 6 Re: Run Program Once
When they try to open the same application put this into the form_load()
Private Sub Form_Load()
If App.PrevInstance = True Then 'Application is already running
MsgBox "Application is already Running, Please exit before opening again!", VbCritical
End If
End Sub
XRsTX at 2007-11-11 17:32:41 >

# 7 Re: Run Program Once
I am a little confused. In each reply the PrevInstance Property is discussed.
In your post you talk about one person has the program open and minimizes it, then another person opens the program. Is the second person opening the program on the same pc or is this a program stored on a network drive and two different people on two different pc's start the program from the network drive? If it is a program stored on a network drive and two people try to run it on different pc's, the PrevInstance Property will not work.