Access交流中心

北京 | 上海 | 天津 | 重庆 | 广州 | 深圳 | 珠海 | 汕头 | 佛山 | 中山 | 东莞 | 南京 | 苏州 | 无锡 | 常州 | 南通 | 扬州 | 徐州 | 杭州 | 温州 | 宁波 | 台州 | 福州 | 厦门 | 泉州 | 龙岩 | 合肥 | 芜湖 | 成都 | 遂宁 | 长沙 | 株洲 | 湘潭 | 武汉 | 南昌 | 济南 | 青岛 | 烟台 | 潍坊 | 淄博 | 济宁 | 太原 | 郑州 | 石家庄 | 保定 | 唐山 | 西安 | 大连 | 沈阳 | 长春 | 昆明 | 兰州 | 哈尔滨 | 佳木斯 | 南宁 | 桂林 | 海口 | 贵阳 | 西宁 | 乌鲁木齐 | 包头 |

求大神,我需要在下面代码中加一个,登陆成功同时打开一个名称为“操作菜单”的窗体,语句如何添加呢?

dd  发表于:2014-07-17 12:58: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
 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


 

Top
麥田 发表于:2014-07-17 13:12:35

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



dd 发表于:2014-07-17 16:09:19
谢谢!太感谢了!

总记录:2篇  页次:1/1 9 1 :