sameh.abdelkawy
Member
- Local time
- Today, 08:57
- Joined
- Dec 18, 2021
- Messages
- 46
Excellent solution. It worked smoothly. Thanks a lot!Do not open a recordset. Do not use FindFirst. Use a domain function for this simple query. All you need to do is use BOTH userID and password as the criteria. Doing it as you are with two separate "FindFirst" operations, you will allow a person to log in as someone else by using the other person's UserID and their own password.
Code:If dCount("*"), "tblUsers", "UserID = '" & Me.UserID & "' AND Password = '" & Me.Password & "'") = 0 Then Msgbox "UserID or Password is invalid, please try again."vbONOnly Exit Sub End If