Try the ASC function:
If Asc(sPassword) = Asc(sPasswordEntered) Then ...
--
--Roger Carlson
www.rogersaccesslibrary.com
Reply to: Roger dot Carlson at Spectrum-Health dot Org
"Tony_VBACoder" <(E-Mail Removed)> wrote in message
news:192e401c44ca3$2acdd810$(E-Mail Removed)...
> In Access 2002 (SP2) with WinXP, I have 2 strings that I
> am comparing when a user enters their password into a
> LogIn form. The variables and their values are below:
>
> ' This is the password stored in the User's table
> sPassword = "robert"
> ' This is the password the entered in the password text
> box on the LogIn Form
> sPasswordEntered = "ROBert"
>
> When the following code is executed, I get a True result,
> when in fact I should get a FALSE result:
>
> If sPassword = sPasswordEntered Then
> bSuccess = TRUE
> Else
> bSuccess = FALSE
> End If
>
> What is the best method to ensure that the user has
> entered the correct password (case sensitivity does matter
> here)?
>