Duplicate forms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi Everyone,
I want to ensure that two copies of a form are not running at the same time
- I don't care of its the first or the second that runs, but not both, or
subsequent.

As always, I thank you in advance in for kind consideration.
Regards,
Pat.
 
In the form open event of one form check to see if the other form is open.
If it is then cancel the Open event:

In frmForm2 open event:

Private Sub Form_Open(Cancel As Integer)
If CurrentProject.AllForms("frmForm1").IsLoaded Then
Cancel = True
End If
End Sub

In frmForm1 open event:

Private Sub Form_Open(Cancel As Integer)
If CurrentProject.AllForms("frmForm2").IsLoaded Then
Cancel = True
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top