|
http://www.office-cn.net/forum.php?mod=viewthread&tid=58192&extra=page%3D3%26amp%3Bfilter%3Dtype%26amp%3Btypeid%3D15
我使用以上的登录,我想在界面上加个“新用户注册”按钮,并点击打开窗体“用户注册”,但是原有设置,必须输入用户密码,才有其他显示,我不知道该怎么做
Option Compare Database
Private Sub Cmd取消_Click()
On Error GoTo Err_Cmd取消_Click
DoCmd.Close
DoCmd.Quit
Exit_Cmd取消_Click:
Exit Sub
Err_Cmd取消_Click:
MsgBox Err.Description
Resume Exit_Cmd取消_Click
End Sub
Private Sub Cmd确定_Click()
On Error GoTo Err_Cmd确定_Click
If Nz([Txt密码]) = Nz(DLookup("[密码]", "用户密码表", "[用户名]=" & "'" & Combo用户名 & "'")) _
And Me.Combo用户名 <> "" Then '验证用户和密码)
DoCmd.Close
DoCmd.Close acForm, "登陆背景", acSaveYes
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = ChrW(23548) & ChrW(-32214)
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
MsgBox "用户名不存在或密码错误", , "请重新输入"
Me.Combo用户名.SetFocus
End If
Exit_Cmd确定_Click:
Exit Sub
Err_Cmd确定_Click:
MsgBox Err.Description
Resume Exit_Cmd确定_Click
End Sub
Private Sub 新用户注册_Click()
On Error GoTo Err_新用户注册_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = ChrW(29992) & ChrW(25143) & ChrW(27880) & ChrW(20876)
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_新用户注册_Click:
Exit Sub
Err_新用户注册_Click:
MsgBox Err.Description
Resume Exit_新用户注册_Click
End Sub
这是所有代码,怎么解决,请具体解答,本人初学,万分感谢! |
|