9-Digit Zip Code Mask without the dash

G

Guest

I would like to use a 9-digit zip code mask. I would like the dash to appear
only when there are 9 digits. If there are only 5 digits in the zip code, I
would like the dash to disappear. Does anyone know how to do this?

Thanks.
 
A

Al Campagna

Kokomojo,
Make the mask
000009999
On the AfterUpdate event of ZipCode place this code
If Len(ZipCode) >5 Then
ZipCode = Left(ZipCode,5) & "-" & Right(ZipCode,4)
End If
 
A

Al Campagna

Kokomojo,
Just a note... using this method it would be best not to enter a "-", just let the
code do it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top