Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'Verify the first two digitd of zip code
- Dim ZipFirstTwo As Integer
- If Not IsNull([State]) And Not IsNull([Zip]) Then
- ZipFirstTwo = Val(Left([Zip], 2))
- Select Case [State]
- Case "MI"
- If ZipFirstTwo < 48 Or ZipFirstTwo > 49 Then
- DoCmd.CancelEvent
- MsgBox "Michigan zip codes must start 48 or 49"
- Me.Undo
- [Zip].SetFocus
- End If
- End Select
- End If
Add Comment
Please, Sign In to add comment