This function returns a true/false answer to whether or not a form is open, paste it in a module and you're good to go:
[tt]
Function IsLoaded(ByVal strFormName As String) As Integer
IsLoaded = False
Dim frm As Form
For Each frm In Forms
If frm.Name = strFormName Then
IsLoaded = True
Exit For
End If
Next frm
Correct me if I'm wrong, but your way forces the system to go through every form and check it's object state from the msys tables. My way looks at the forms collection so it only looks at forms that are open, so this method is faster, because it will almost always have fewer forms to inspect that yours.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.