函數二
Function IsFormLoaded(strFrmName As String) As Boolean
Const conFormDesign = 0
Dim intX As Integer
IsFormLoaded= False
For intX = 0 To Forms.Count - 1
If Forms(intX).FormName = strFrmName Then
If Forms(intX).CurrentVIEw <> conFormDesign Then
IsFormLoaded= True
Exit Function ' Quit function once form has been found.
End If
End If
Next
End Function