Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: VB5,VB6
Expertise: beginner
Sep 20, 2001

CheckUSState - Validate a US state initial

' Return True if the passed State initials are valid
' Example:
'    MsgBox CheckUSState("NY")

Public Function CheckUSState(ByVal State As String) As Boolean
    If Len(State) = 2 And InStr(",AL,AK,AZ,AR,CA,CO,CT,DE,DC,FL,GA,HI,ID,IL,IN,I" _
        & "A,KS,KY,LA,ME,MD,MA,MI,MN,MS,MO,MT,NE,NV,NH,NJ,NM,NY,NC,ND,OH,OK,OR,P" _
        & "A,RI,SC,SD,TN,TX,UT,VT,VA,WA,WV,WI,WY,", "," & UCase(State) & ",") > _
        0 Then
        CheckUSState = True
    End If
End Function
Marco Bellinaso
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap