Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I stop multiple instances of my application from executing.

Status
Not open for further replies.

rarubio1

Programmer
Jan 25, 2002
64
US
I need to multiple instances of my application from executing. I read a prior thread and used their sample code:

If App.PrevInstance Then
Dim S As String
S = Caption
Caption = "Something else..."
AppActivate S
Unload Me
Else
'start program normally
End If

BUT, that did not work. Could someone please HELP!!!!

Thanks,
RR :)
 
Private Sub Form_Load()
If App.PrevInstance Then
MsgBox "There Is Another Instance Of This" & vbCrLf & _
" Program Running At This Time.", vbInformation, "UnLoading"
End
End If
End Sub


Works for me...
 
This worked but not in the Form_load procedure. I had to place the code in the Form_Initialize procedure.

Thanks!
 
No problem. Yea, depends on what you have happening on form load.

Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top