! How Do I Check Form is Opened !

  • Thread starter Thread starter Wembly
  • Start date Start date
W

Wembly

Hi,

How would I write the code to check whether a form is
opened or not?

Thanks for your help.

Wembly
 
Dim abc As Form
For Each abc In Forms
If abc.name = "Form2" Then MsgBox "Form2 is already open"
Next

May
MCP in Access and SQL Server
 
Or, slightly more efficiently,

Dim abc As Form
For Each abc In Forms
If abc.name = "Form2" Then
MsgBox "Form2 is already open"
Exit For
End If
Next
 
Back
Top