Hi,
I have written below code for user login and table given below tbluser, But
while login if i am login for row 1 with password of row 2 it is authenticating. Please suggest where i have to correct
tbluser
ID UserName UserLogin Password UserSecurity
1 Naveen Nani **** Admin
2 2022 Blr *** User
Private Sub Command1_Click()
If IsNull(Me.txtLoginID) Then
MsgBox "Please Enter LoginID", vbInformation, "LoginID Required"
Me.txtLoginID.SetFocus
ElseIf IsNull(Me.txtPassword) Then
MsgBox "Please Enter Password", vbInformation, "Password Required"
Me.txtPassword.SetFocus
Else
'Process the job
If (IsNull(DLookup("UserLogin", "tblUser", "UserLogin ='" & Me.txtLoginID.Value & "'"))) Or _
(IsNull(DLookup("Password", "tblUser", "Password ='" & Me.txtPassword.Value & "'"))) Then
MsgBox "Incorrect LoginID or Password"
Else
'MsgBox "LoginID and Passowrd Correct"
DoCmd.Close
DoCmd.OpenForm "frmTempLabelsToPrint"
End If
End If
End Sub
I have written below code for user login and table given below tbluser, But
while login if i am login for row 1 with password of row 2 it is authenticating. Please suggest where i have to correct
tbluser
ID UserName UserLogin Password UserSecurity
1 Naveen Nani **** Admin
2 2022 Blr *** User
Private Sub Command1_Click()
If IsNull(Me.txtLoginID) Then
MsgBox "Please Enter LoginID", vbInformation, "LoginID Required"
Me.txtLoginID.SetFocus
ElseIf IsNull(Me.txtPassword) Then
MsgBox "Please Enter Password", vbInformation, "Password Required"
Me.txtPassword.SetFocus
Else
'Process the job
If (IsNull(DLookup("UserLogin", "tblUser", "UserLogin ='" & Me.txtLoginID.Value & "'"))) Or _
(IsNull(DLookup("Password", "tblUser", "Password ='" & Me.txtPassword.Value & "'"))) Then
MsgBox "Incorrect LoginID or Password"
Else
'MsgBox "LoginID and Passowrd Correct"
DoCmd.Close
DoCmd.OpenForm "frmTempLabelsToPrint"
End If
End If
End Sub