Do you have Option Compare at the top of your code modules? Then the db is not case sensitive. I believe you'd need Option Binary - at least in the login code module.
Please use code tags (# on forum toolbar) to make your code easier to read. I did a quick scan and see that if the user name is null, after the message box there is no Exit Sub, so code just keeps on going. More like
Code:
If IsNull(Me.txtUserName) Then
MsgBox "Please enter User Name", vbInformation, "Password Required"
Me.txtUserName.SetFocus
Exit Sub
End If
These tests should be stand alone tests - not Else's (or at least do both, report that one of them is incorrect, but Exit Sub after 2nd test).
Your IsNull test can return a value which may be incorrect - but not null - thus the login and password pass regardless of what it is. That's all I've got after a quick look because I have a question: are you sure you need a login scheme at all? The only yes reason I can think of is that multiple users share a Windows login. If not, and everyone has to log into Windows, then you can get the Windows user name, look that up in a table, and if that user name isn't there, they don't get in.
Regardless of which approach you take, make sure people can't poke around in your tables and view/edit things that will give them permissions they should not have.
Last edited by Micron; 02-22-2020 at 10:22 PM.
Reason: clarification
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.