0

タイトルにあるように、Access 2013 でのフォーム ログインについて誰か助けてくれませんか。各ユーザー ID でログインが成功するたびに、ユーザー名テーブル (datetype datetime) のタイムスタンプを更新したいだけです。もう1つの問題は、ログインに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
4

2 に答える 2