Number fields with leading zeros

  • Thread starter Thread starter murfitUK
  • Start date Start date
M

murfitUK

I've looked in the help files but can't find the answer.

Using Access 2000. I need to create a field that contains a 4-digit number.
Usually this will be something like 3824. However, some entries will have
only 3, 2 or even just one digit but it needs to be displayed as 0006 or
0823 etc.

Is this possible to do in Access? I used to keep the database in Microsoft
Works and it was possible to display the leading zero(s) in Works but I
can't see how to do it in Access.

Thanks.
 
murfitUK said:
I've looked in the help files but can't find the answer.

Using Access 2000. I need to create a field that contains a 4-digit
number. Usually this will be something like 3824. However, some
entries will have only 3, 2 or even just one digit but it needs to be
displayed as 0006 or 0823 etc.

Is this possible to do in Access? I used to keep the database in
Microsoft Works and it was possible to display the leading zero(s) in
Works but I can't see how to do it in Access.

Thanks.

Two choices. Either keep using a number DataType and set the format property to
"0000" on all forms and reports using the field or change the field DataType to
Text.
 
Ah, now I see. I can change the way the field looks in forms or reports but
not how it stores the data in the table.

Thanks Rick.
 
Back
Top