Public Function isopen(ByVal strformname As String) As String
Const condesignview = 0
Const conobjstateclosed = 0
isopen = False
If SysCmd(acSysCmdGetObjectState, acForm, strformname) <> _
conobjstateclosed Then
If Forms(strformname).CurrentView <> condesignview Then
isopen = True
End If
End If
End Function
Private Sub Form_Open(Cancel As Integer)
Dim frm As Form
frm=密码 '窗体名
If isopen(frm) = False Then
MsgBox "没有登陆啊", vbOKOnly, "提示"
DoCmd.Quit
End If
End Sub
为什么 If isopen(frm) = False Then 中的类型不符呢?
[此贴子已经被作者于2002-7-21 20:52:20编辑过]
|