0

I want a code to lookup for a username and compare the password ( case sensitive ) using the dlookup here is my code and it doenst care for the pass if it is capital letter nor not

If (IsNull(DLookup("UserName", "UserID", "UserName='" & Me.Userbox.Value & "'and [password] = '" & Me.Passbox & "'"))) Then

Thanks

walid761
  • 35
  • 3
  • 4
    Store them in variables and use the `StrComp` function to check them (use binary comparison). https://learn.microsoft.com/en-us/office/vba/language/reference/user-interface-help/strcomp-function – Kostas K. Jun 21 '22 at 10:22
  • 1
    Don't ever store passwords as clear text. See, for example, my article [Storing passwords in VBA using the Microsoft NG Cryptography (CNG) API](https://github.com/GustavBrock/VBA.Cryptography/blob/main/Next%20Generation%20Cryptography%20Part%205.md). – Gustav Jun 21 '22 at 12:47
  • Hopefully the userbox and passbox never contain a single quote character. (O'Brian for example) – braX Jun 21 '22 at 14:08

0 Answers0