Is alpha Numeric

  • Thread starter Thread starter Angel_G
  • Start date Start date
A

Angel_G

How can I tell if a field on a form (UserPassword) contains an Alpha Numeric
value. I want to make sure the field contains both, numbers and letters.
Can anyone help me with the right code?
 
Hi Angel

If Me!UserPassword Like "*[A-Z]* And Me!Userpassword Like "*#*" Then
' password contains both numbers and letters
Else
' invalid
End If

If you want to also check that the password contains *only* alphanumeric
characters, then add a third test:
... And Not (Me!UserPassword Like "*[!A-Z0-9]*")
 
Thank you.

Graham Mandeno said:
Hi Angel

If Me!UserPassword Like "*[A-Z]* And Me!Userpassword Like "*#*" Then
' password contains both numbers and letters
Else
' invalid
End If

If you want to also check that the password contains *only* alphanumeric
characters, then add a third test:
... And Not (Me!UserPassword Like "*[!A-Z0-9]*")
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand


Angel_G said:
How can I tell if a field on a form (UserPassword) contains an Alpha Numeric
value. I want to make sure the field contains both, numbers and letters.
Can anyone help me with the right code?
 
Back
Top