Guest User

Untitled

a guest
Apr 19th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. 'Verify the first two digitd of zip code
  2. Dim ZipFirstTwo As Integer
  3. If Not IsNull([State]) And Not IsNull([Zip]) Then
  4. ZipFirstTwo = Val(Left([Zip], 2))
  5. Select Case [State]
  6. Case "MI"
  7. If ZipFirstTwo < 48 Or ZipFirstTwo > 49 Then
  8. DoCmd.CancelEvent
  9. MsgBox "Michigan zip codes must start 48 or 49"
  10. Me.Undo
  11. [Zip].SetFocus
  12. End If
  13. End Select
  14. End If
Add Comment
Please, Sign In to add comment