How do I find out how many instances of a particular Form are open?
I tried this but it gives a wrong result:
Code:Dim frm As Form
For Each frm In Forms
If (frm.Name = "Form1") Then
MsgBox frm.Count
End If
Next
Printable View
How do I find out how many instances of a particular Form are open?
I tried this but it gives a wrong result:
Code:Dim frm As Form
For Each frm In Forms
If (frm.Name = "Form1") Then
MsgBox frm.Count
End If
Next
vb Code:
Dim frm As Form, frmcnt as long For Each frm In Forms If (frm.Name = "Form1") Then frmcnt = frmcnt + 1 End If msgbox "Number of forms open is " & frmcnt Next