VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Validates two-digit State US postal code

by Ian lent (6 Submissions)
Category: String Manipulation
Compatability: Visual Basic 4.0 (32-bit)
Difficulty: Unknown Difficulty
Originally Published: Sun 16th January 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Validates two-digit State US postal code

Rate Validates two-digit State US postal code



' Purpose: Checks to see if strState is a valid postal state code.
' In: strZIP - Candidate State postal code
' Out:
' Returns:      True - if strState is a valid postal state code.
'               False - if it is not
' Date: 1/16/2000
' Programmer: Ian Lent
' Last Modified:
' Note: Not case sensitve
    Select Case UCase(strState)
        Case "AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", _
            "DC", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", _
            "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", _
            "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", _
            "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", _
            "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY"
            ValidateState = True
        Case Else   ' It's not a postal state code.
            ValidateState = False
    End Select
End Function



Download this snippet    Add to My Saved Code

Validates two-digit State US postal code Comments

No comments have been posted about Validates two-digit State US postal code. Why not be the first to post a comment about Validates two-digit State US postal code.

Post your comment

Subject:
Message:
0/1000 characters