如标题所述,任何人都可以帮助我了解我在 Access 2013 上的表单登录。我只想为每个用户 ID 上的每次成功登录在我的用户名表(日期类型日期时间)上更新时间戳。另一个问题是我想为每 3 次登录失败锁定用户登录表单。
Private Sub CmdLogin_Click()
If IsNull(Me.cboNama) Or Me.cboNama = "" Then
MsgBox "Please fill your username first!", vbOKOnly, "Input Username"
Me.cboNama.SetFocus
Exit Sub
End If
If IsNull(Me.txtPword) Or Me.txtPword = "" Then
MsgBox "Please fill your password!", vbOKOnly, "Input Password"
Me.txtPword.SetFocus
Exit Sub
End If
If Me.txtPword.Value = DLookup("Password", "Ms_UserID", "[Password]='" & Me.txtPword.Value & "'") Then
MyUserID = Me.cboNama.Value
MsgBox "Login Success", vbOKOnly, "Message"
'Me.Last_Login = DateTime()
DoCmd.Close acForm, "Frm_Login", acSaveNo
DoCmd.OpenForm "Ms_Userid"
Else
MsgBox "Wrong Username/Password! Please specify your caps lock, Boss..", vbCritical, "Error Message"
Me.txtPword.SetFocus
End If
End Sub