formatting for zip codes & phone numbers

G

Guest

How do you format for zip codes and phone numbers like the date. When I
enter in a zipcode 01234 I get 1234. Also I would like phone numbers to
come up in the 123-456-7890 format.
 
J

Jeff Boyce

If your table is storing "1234" for a zipcode you enter as "01234", the
field is defined as a number. I know "01234" LOOKS like a number, but it
isn't, really, in this case. It's a "code", and you won't need to do any
"number-like" things to it (add, subtract, average, etc.). Change the field
type to text.

There's a section in Access HELP that covers the formatting you can use for
phone numbers.

Regards

Jeff Boyce
<Office/Access MVP>
 
G

Guest

Jeff Boyce covered that your fields need to be text and not numbers. I'll
also add that Social Security Numbers have the same problem with leading
zeros. As a rule of thumb, if you aren't going to do math or sort on the
numbers, store them as text. For example you wouldn't multiply a ZipCode time
3 for any reason so it's better stored as text.

I also recommend that you don't use an input mask or format either a ZipCode
or Telephone field if you ever, ever think that you'll be dealing with a
person in another country. Their postal codes and phone numbers are usually
much different that in the USA.
 

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