You can use this code on the login button:
If (IsNull(DLookup("[EmployeeID]", "tblEmployees", "[EmployeeID] ='" & Me.USERLOGIN.Value & "' And EmployeePassword = '" & Me.PASSWORD.Value & "'")))
Then:
MsgBox "Incorrect ID or PASSWORD", vbInformation, "worng LOGIN"Me.USERLOGIN = Null Me.PASSWORD = Null
Else
And after else you open the target form this will do:
- [EmployeeID]=is the name of the username field in the access table
- tblEmployees=is the name of the access table
- Me.USERLOGIN.Value=is the name of the user name field in the login form
- EmployeePassword=is the name of the password field in the access table
- Me.PASSWORD.Value=is the name of the password field in the login form
Discuss This Question: