Noticed a prob in my password checkingform. Example, in my tblUsers, I have Username and Password. Lets say one Username is "John", and his Password is "Blue". Another username is "Bob" amd his password is "Red" In my form, if one enters Username = John and Password = Red, it still works. How do I specifiy within my code that the Username and Password have to be in the same record.
Private Sub SignIn_Click()
Dim User As String
Dim pass As String
User = Nz(DLookup("[username]", "tblUsers", "[username]='" & Me.username & "'"), "")
pass = Nz(DLookup("[password]", "tblUsers", "[password]='" & Me.password & "'"), "")
If User = Forms!WDMLoginAccept!username Then
DoCmd.Close acForm, "WDMLoginAccept", acSaveNo
DoCmd.OpenForm "WDM_1", acNormal
Forms![WDM_1]!WDMaccept = True
Forms![WDM_1]!WDMaccept.Visible = True
Forms![WDM_1]!WDMaccept.Locked = True
Else
MsgBox "Invalid Username/Password combination, please try again"
End If
End Sub
Thanks
Private Sub SignIn_Click()
Dim User As String
Dim pass As String
User = Nz(DLookup("[username]", "tblUsers", "[username]='" & Me.username & "'"), "")
pass = Nz(DLookup("[password]", "tblUsers", "[password]='" & Me.password & "'"), "")
If User = Forms!WDMLoginAccept!username Then
DoCmd.Close acForm, "WDMLoginAccept", acSaveNo
DoCmd.OpenForm "WDM_1", acNormal
Forms![WDM_1]!WDMaccept = True
Forms![WDM_1]!WDMaccept.Visible = True
Forms![WDM_1]!WDMaccept.Locked = True
Else
MsgBox "Invalid Username/Password combination, please try again"
End If
End Sub
Thanks