Have your code call a function named IsFormOpen - the call would
look something like this:
If IsFormOpen("form_name") = True Then ...
your_code_goes_here
End If
Declare a public function named IsFormOpen() - here's the code:
Public Function IsFormOpen(ByVal strObjectName As String) As Boolean
If SysCmd(acSysCmdGetObjectState, acForm, strObjectName) = acObjStateOpen Then
If Forms(strObjectName).CurrentView = 1 Then
IsFormOpen = True
Else
IsFormOpen = False
End If
End If
End Function
|