1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
Public Function IsFrmLoaded(szName As String) As Boolean
'This function will return True if the form is open
' and False if it is closed.
On Error GoTo Err_
' Dim num As Long
' IsFrmLoaded = False
' For num = 0 To Forms.Count - 1
' If Forms(num).FormName = szName Then
' IsFrmLoaded = True
' Exit Function ' quitte la fonction une fois le formulaire trouvé.
' End If
' Next
IsFrmLoaded = (SysCmd(acSysCmdGetObjectState, acForm, szName) <> 0)
exit_:
Exit Function
Err_:
MsgBox err.Description, vbCritical, "Erreur Function IsFrmLoaded"
Resume exit_
End Function |
Partager