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