Check if form is open

1

http://www.thescripts.com/forum/thread205622.html by Trevor Best

Private Sub Command90_Click()
isopen = SysCmd(acSysCmdGetObjectState, acForm, "frmoperator")

If isopen = "1" Then
a = MsgBox("hourra" & isopen, vbOKOnly, "leb")
Else
a = MsgBox("noporo" & isopen, vbOKOnly, "hopa")
End If
End Sub
 

2

http://www.thescripts.com/forum/thread566852.html by Tanis

Re: vb to check form is open


Courtesey of the Dev Ashish web site.

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, "frmoperator") <> 0 Then
If Forms("frmoperator").CurrentView <> 0 Then
fIsLoaded = True
End If
End If
End Function
'****** Code End ********