Validate USERID convention

bizjosh

Member
Joined
Mar 16, 2005
Messages
23
Programming Experience
Beginner
hi, how do i validate a userid to ensure
they are 3 uppercase digits followed by
6 digitals, otherwise it will reject it.

ABC123456 - OK

abc123456 -NOT OK
ab12345 -NOT OK
12abc -NOT OK

I'm thinking of using substring to test for the 6
digits to ensure it is between 1-999999,
not sure if that works, anyone can assist?
 

vbArch

Member
Joined
Apr 11, 2005
Messages
11
Programming Experience
10+
look at the like function
try this
Public Function ValidPassword(ByVal Password As String) As Boolean

Return Password Like "[A-Z][A-Z][A-Z]######"

End Function

 

TPM

Well-known member
Joined
Dec 7, 2004
Messages
623
Location
CA
Programming Experience
3-5
It's been quite a while since I've done anything with regular expressions so I could be wrong but couldn't you just do [A-Z]3? I think you would also want [0-9]6 in there as well?

TPM
 
Top Bottom