Keep leading zeros in a numeric field

C

Curt Gardiner

Is there any way to stop Access from removing the leading
zeros in a numeric field as you are entering data in a
Table. ie. enter 000123 and Access stores 123
 
K

Ken Snell

Only if you change the field type to Text.

If you want to keep the field as numeric, then don't worry about the "loss"
of leading zeroes, as you can always use the Format command to display the
number with the leading zeroes:

Format([NumberField], "000000")

And there are other variations on this theme that will produce similar
results.
 
J

Jeff Boyce

Curt

To extend Ken's response, "why"? As in, "why do you need to preserve the
leading zeros?" I'm asking about the underlying business need.

Good luck

Jeff Boyce
<Access 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

Top