Copy and paste the following function to a module and save:
Function FormIsLoaded(MyFormName As String) As Boolean
'
' Determines if a form is loaded.
'
Dim i As Integer
FormIsLoaded = False
For i = 0 To Forms.Count - 1
If Forms(i).FormName = MyFormName Then
FormIsLoaded = True
Exit Function ' Quit function once form has been found.
End If
Next i
End Function
Now to use this in your code:
If FormIsLoaded("TheFormNameHere") Then
' Do whatever if form loaded
Else
' Do whatever if form is not loaded
End If
HTH
RDH