
Originally Posted by
langals
Hi there
Is there any way to prevent more than one instance of one's application to run at the same time? Is there any way to check when the application loads if an instance of the app is already running and if it is then don't load the application?
Microsoft seems to do this with Office applications.
Many thanks
langals
Try something like this:
VB Code:
Private Sub Form_Load()
Dim frmMyForm As Form
If App.PrevInstance = True Then
For Each frmMyForm In Forms
Unload frmMyForm
Set frmMyForm = Nothing
Next frmMyForm
Set frmMyForm = Nothing
End
End If
End Sub
Cheers,
RyanJ