打印本文 打印本文 关闭窗口 关闭窗口
判断窗体是否打开的两种方法
作者:武汉SEO闵涛  文章来源:敏韬网  点击数715  更新时间:2009/4/22 20:22:30  文章录入:mintao  责任编辑:mintao
判断窗体是否打开的两种方法
Function IsLoaded(strName As String, Optional intObjectType As Integer =
acForm)
IsLoaded = (SysCmd(acSysCmdGetObjectState, intObjectType, strName) <> 0)
End Function

函数二
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

打印本文 打印本文 关闭窗口 关闭窗口