设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

判断窗体是否打开的两种方法

1970-1-1 08:00| 发布者: 微软| 查看: 2261| 评论: 0

整理修改:tmtony(王宇虹) http://www.office-cn.net

判断窗体是否打开的两种方法
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

最新评论

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2024-5-7 01:45 , Processed in 0.077908 second(s), 16 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

返回顶部