Quote 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:
  1. Private Sub Form_Load()
  2.     Dim frmMyForm As Form
  3.     If App.PrevInstance = True Then
  4.         For Each frmMyForm In Forms
  5.             Unload frmMyForm
  6.             Set frmMyForm = Nothing
  7.         Next frmMyForm
  8.         Set frmMyForm = Nothing
  9.         End
  10.     End If
  11. End Sub

Cheers,

RyanJ