'自定义函数 IsYlwjcct("窗体名") (如果指定的窗体打开,返回True)
Function IsYlwjcct(ByVal strFormName As String) As Boolean
Const conObjStateClosed = 0
Const conDesignView = 0
If SysCmd(acSysCmdGetObjectState, acForm, strFormName) <> conObjStateClosed Then
If forms(strFormName).CurrentView <> conDesignView Then
IsYlwjcct = True
End If
End If
End Function