! How Do I Check Form is Opened !

W

Wembly

Hi,

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

Thanks for your help.

Wembly
 
M

May

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
 
D

Douglas J. Steele

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
 

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

Top