本帖最后由 henterwu 于 2020-2-13 11:20 编辑
登录成功后不能打开其他窗体?
Private Sub 登录系统_Click()
If IsNull(UserName) Then
MsgBox "用户名不能为空,请重新选择!", vbExclamation + vbOKOnly, "提醒您!"
Me.UserName.SetFocus
Else
If IsNull(password) Then
MsgBox "注意,您忘了输入密码!", vbExclamation + vbOKOnly, "提醒您!"
Me.password.SetFocus
Else
IfDLookup("Password", "UserList", "Username='"& UserName & "'") = [password] Then
Me.Visible = False
Me.password = Null
MsgBox "登录成功!", vbExclamation, "提醒您"
' DoCmd.OpenForm "课件考核记录" '加此句后系统界面消失,ldb文件无法删除
Else
MsgBox "您输入的密码有误,请重新输入,注意大小写!", vbExclamation + vbOKOnly, "提醒您!"
Me.password = Null
Me.password.SetFocus
End If
End If
End If
End Sub
课件考核记录窗体为弹出式窗体,单独打开没问题?麻烦老师指导一下代码问题在哪里。谢谢!
|