|
将登入的代码修改如下:
Private Sub cmdOK_Click()
If Me.cboUserID = "" Or IsNull(Me.cboUserID) Then Exit Sub '没有选择用户不处理
If Me.Password = "" Or IsNull(Me.Password) Then Exit Sub '没有输入密码不处理
If Trim(Me.Password) = Trim(DLookup("[password]", "user", "[UserID]=" & Me.cboUserID)) Then
DoCmd.OpenForm ("Main")
GuserID = Me.cboUserID
Call insertLogo("用户登陆")
Me.Visible = False
Else
MsgBox "Password is error,please retype again", vbOKOnly, "Note"
Me.Password.SetFocus
End If
End Sub |
|