How do I add three leading zeros to a number field ?

G

Guest

I have a database in which we are keeping track of pledge numbers. The
pledge number string is ten characters long, however, all pledges at this
point are only up to seven characters. When entering the pledge number into
a field, how do I set it up so Access automatically adds enough zeros before
the pledge number in order to make it ten characters long?
 
R

Rick B

A NUMBER would not need leading zeros. 000000000005 is exactly the same as
5 or 0005 or 0000005. If you care about the zeros, you could change it to a
text field. You could then run an update query to correct all the existing
entries.


Or, check out the "FORMAT" option in your field.
 
A

Allen Browne

When you open your pledge table in design view, what is the Data Type of
this field?

If is it Number, you can just set the Format property to 10 zeros, and it
will display the leading zeros for you.
 

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