Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I test if a field begins with a letter A-Z 2

Status
Not open for further replies.

colezpapa3

Programmer
Dec 8, 2007
73
US
I want to test the first character in a field if its one of the letters of the alphabet...I forgot how to do this...

If Left(field,1) = "A" Or Left(field,1) = "B" ...etc.
Without writing all the code...
 
Code:
c = UCase(Left(field,1))
If c >= "A" AND c <= "Z"
 
Another way:
If field Like "[A-Z]*" Then

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PHV,

I didn't know you could do that! Have a star for that one. :)

Ed Metcalfe.

Please do not feed the trolls.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top