Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need help formatting an auto number field.

Status
Not open for further replies.

rarubio1

Programmer
Jan 25, 2002
64
US
I am creating a table in Access that uses an auto number field as the primary key field. My supervisor has asked me to format this key field into a four digit number so that now the number 1 becomes 0001, 2 becomes 0002, and so on. Can anyone help with this task?

Thanks in Advance,
RR :)
 
Simply use the Format([name of field], "0000") As FieldName in your queries.
Don't mix presentation problems with storage problems.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
An auto number is usually stored as a Long Integer. Your suprevisor's request has to do with how the number is displayed.

Open the table containing the auto number in design view. Click on the auto number field and enter 0000 in the format box. This should cause the auto number field to display leading zeros on all values less than 1000.

You may need to add the same format for this field on all reports or forms that you have already created.

MrBill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top