Compare 2 Txtbox

daveee143

Registered User.
Local time
Today, 05:57
Joined
Apr 30, 2011
Messages
24
i'm having trouble to compare 2 txtboxes? how can i do that?

i set a 3 txt box

Username
Password
Password2

i need to compare the 2 password txtbox? how can i do that? i'm so sorry i'm new in this pl Y_Y could any one help me?
 
You could do something along the lines of;
Code:
If Me.Password = Me.Pasword2 Then
     MsgBox "Congratulations your Passwords match"
Else
     MsgBox "Epic Fail"
End If
 
However if you want to compare the Password and User Name entered on a form with the Password and User Name store in a table you would need something like;
Code:
If Me.Password = [URL="http://www.techonthenet.com/access/functions/domain/dlookup.php"]DLookup[/URL]("Password", "TBL_UserDtls", "UseName = '" & Me.UserName & "'") Then
     MsgBox "Congratulations your password is correct"
Else
     MsgBox "Epic Fail"
End If
 
You could do something along the lines of;
Code:
If Me.Password = Me.Pasword2 Then
     MsgBox "Congratulations your Passwords match"
Else
     MsgBox "Epic Fail"
End If

--

It works.. however the problem is it is not case sensitive.. How can I code that even the case sensitivity will matter? thanks.
 
For a case sensitive comparison try;
Code:
    If CBool(InStrB(Me.Password, Me.Password2)) Then
        MsgBox "Congratulations your Passwords match"
    Else
        MsgBox "Epic Fail"
    End If
 

Users who are viewing this thread

Back
Top Bottom