Find out if a form is open
Posted by Superadmin on May 02 2019 06:14:49

Find out if a form is open

 

Find out if a form is open

Author(s)
Dev Ashish

(Q) How do I find out from code if a form is open or not?

(A) Pass the form name to the following function.  Function will return True if form is open and False if it's not.

'****** Code Start ********
Function fIsLoaded(ByVal strFormName As String) As Integer
'Returns a 0 if form is not open or a -1 if Open
    If SysCmd(acSysCmdGetObjectState, acForm, strFormName) <> 0 Then
        If Forms(strFormName).CurrentView <> 0 Then
            fIsLoaded = True
        End If
    End If
End Function
'****** Code End ********