How can I change the number of digits for my primary key

mlamont

Registered User.
Local time
Today, 21:56
Joined
Jun 25, 2001
Messages
45
Hi, in my table I have my primary key which is a number and they range anywhere from 1 - 1000 for ex one record's primary key may be 12, and another record's primary key may be 1023. What I need to do is to convert all of the numbers for my primary key in my table to 6 digits, ie 12 becomes 000012, and 1023 becomes 001023.

Can anybody help me?
 
Put "000000" (without quotes) in the Format property of the field in the table.
 
But remember that if the primary key is an Integer (not a Long), you only have 5 digits to begin with. So make sure you have the primary key as a Long. If it is an integer, you can safely go into design mode and change it to long, because expanding a field is always legal. It is going the other way that gets dangerous.
 

Users who are viewing this thread

Back
Top Bottom