Verifying Zip Code Range
Hello I'm trying to verify Zip Code for TX. I want to set the range from 73 to 79. If the ZipCode doesn't fall into that range then it will alert the user of their mistake. Any tips on how to set the range from 73 to 79? I'm very new to VBA and is just learning. Below is what I have so far.
Private Sub Postal_Code_BeforeUpdate(Cancel As Integer)
If IsNull([Postal Code]) Then
strMsg = "You must enter a Zip Code"
strTitle = "Zip Code Required"
MsgBox strMsg, vbOKOnly, strTitle
Cancel = True
Else
If Me.State = "TX" Then
strFirstTwo = Left([Postal Code], 2)
strMsg = "Wrong Zip Code"
strTitle = "Zip Code Error"
MsgBox strMsg, vbOKOnly, strTitle
End If
End If
|