Leading zero in table

L

Larry

Using Access 2002 - (Office XP) I have created a program
in Access 2002. In one of my data tables the field
sometimes requires a leading zero (contractors ID
numbers). I have tried it as a TEXT filed, Long Integer,
Number, and even currency all to no avail. When the data
are transfered to the finished form, the zero is dropped,
and this causes the invoice to bomb because the field is a
look up field. Without the zero, the proper contractor
cannot be identified and the program generates an error.

Is there a solution for this. NOTE: When I change it to
a text field, it works a couple of times and then it goes
right back to dropping the zero.

If any have a solution, please email me.

Thanks
 
A

AJ Raiber

In the input mask for the field use a string of zeros to
indicate how many positions the number should contain and
then if the number falls short, Access will fill in with
leading zeros.

HTH.

AJ
 
B

Bruce M. Thompson

Using Access 2002 - (Office XP) I have created a program
in Access 2002. In one of my data tables the field
sometimes requires a leading zero (contractors ID
numbers). I have tried it as a TEXT filed, Long Integer,
Number, and even currency all to no avail. When the data
are transfered to the finished form, the zero is dropped,
and this causes the invoice to bomb because the field is a
look up field. Without the zero, the proper contractor
cannot be identified and the program generates an error.

Is there a solution for this. NOTE: When I change it to
a text field, it works a couple of times and then it goes
right back to dropping the zero.

I'm not sure why your attempt at using a text field is failing after a "couple
of times", but that approach is the only one that will work when you want to
store a number with leading zeros. Make sure that you don't have a number
"format" set in any of the controls that display the value.

You also make reference to transferring the data "to the finished form" where
the leading zero is dropped. Are you appending the records to another table? Is
the "Contractor ID" field in the target table also defined as a "text" field? If
that field is defined as a number field in the target table, the "Contractor ID"
value will lose the leading zeros because those values will be converted to
numbers.
 

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