Holding Zero Value

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello All-

I have created a database to track incoming applications which includes the
applicant's address. In the table I have created, the Zip Code field is not
holding a zero value; so if the zip code is 03246 it shows up as 3246. I
have tried using input masks and allowing zero lengths and nothing is
working. I really need this to hold the whole zip code since I will be using
the db to create mailing lables. Help! Thank you in advance for your time
and response.
 
I have tried that, in fact, when you use the mask for zip code, it
autmatically changes it from number to text. As I said in my original post,
this does not help. Thank you anyways!
 
Actually, your original post says absolutely nothing about the field being
text.

Assuming you're typing the 0 in, there's no way it's going to be deleted if
the field is text, whereas it's guaranteed to be deleted if it's numeric.
 
Thanks to everybody who has replied thus far. The reason I said it was
formatted for text is that when you use an input mask for zip, it
automatically changes the data type to text. In my original message, I did
state that I already tried to use an input mask, therefore the text format
has already been tried. Just for kicks and giggles, I just got rid of the
input mask and tried formatting the field for regular text, but it is still
dropping the zero. I am not sure what I am doing wrong or what I am not
seeing. The only other thing I can think of is that maybe some VBA code is
getting hung up somewhere and messing things up. Knowing my luck though, it
is more than likely a user error. If anybody would like to take a look at
it, I would not mind sending it via email to the address associated with your
display name. Thanks again for your time and suggestions.
 
Have the field in your table set the type to "number" ("single" field size
should be fine for postal codes). Set the format to "000000" and you will
always have 6 digits in your postal code, i.e. 012345, 000001, etc.

HTH
 
nhvwchic said:
Thanks to everybody who has replied thus far. The reason I said it
was formatted for text is that when you use an input mask for zip, it
automatically changes the data type to text. In my original message,
I did state that I already tried to use an input mask, therefore the
text format has already been tried. Just for kicks and giggles, I
just got rid of the input mask and tried formatting the field for
regular text, but it is still dropping the zero. I am not sure what
I am doing wrong or what I am not seeing. The only other thing I can
think of is that maybe some VBA code is getting hung up somewhere and
messing things up. Knowing my luck though, it is more than likely a
user error. If anybody would like to take a look at it, I would not
mind sending it via email to the address associated with your display
name. Thanks again for your time and suggestions.

If the field is text type, there is nothing I know of short of some sort
of programing that will delete a zero. Have you tried using a letter O?
Take all the formatting off (table and form/query) and try that.
 
The reason I said it was
formatted for text is that when you use an input mask for zip, it
automatically changes the data type to text.

No, it does not (you got me curious so I tried it).

The Input Mask does affect how the *NUMBER, LONG INTEGER* field in the
table is *displayed* but it does not affect what is stored in the
table.

Try it. Open your table in design view; select this Zip field. Look at
the datatype in the second column of the table design grid - I'm quite
certain it will say "Number". And (unless you've changed it yourself)
if you look at the field properties in the lower left of the screen it
will say "Long Integer".

If you change the field type to Text (using the dropdown in the second
column of the table design view) and set the size to 5 (for five-digit
zip), 10 (to allow entry of Zip+4) or 12 (to allow for non-US postal
codes, which won't work in a number field at all) you'll be in good
shape.

John W. Vinson[MVP]
 

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

Back
Top