求大神,我需要在下面代码中加一个,登陆成功同时打开一个名称为“操作菜单”的窗体,语句如何添加呢?
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
If DLookup("Password", "UserList", "Username='" & UserName & "'") = [password] Then
Me.Visible = False
Me.password = Null
MsgBox "登录成功!", vbExclamation, "提醒您"
Else
MsgBox "您输入的密码有误,请重新输入,注意大小写!", vbExclamation + vbOKOnly, "提醒您!"
Me.password = Null
Me.password.SetFocus
End If
End If
End If
End Sub
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
If DLookup("Password", "UserList", "Username='" & UserName & "'") = [password] Then
Me.Visible = False
Me.password = Null
MsgBox "登录成功!", vbExclamation, "提醒您"
DoCmd.OpenForm "操作菜单"
Else
MsgBox "您输入的密码有误,请重新输入,注意大小写!", vbExclamation + vbOKOnly, "提醒您!"
Me.password = Null
Me.password.SetFocus
End If
End If
End If
End Sub
总记录:1篇 页次:1/1 9 1 :