How can I change the number of digits for my primary key (1 Viewer)

mlamont

Registered User.
Local time
Today, 08: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?
 

DBL

Registered User.
Local time
Today, 08:56
Joined
Feb 20, 2002
Messages
659
Put "000000" (without quotes) in the Format property of the field in the table.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 02:56
Joined
Feb 28, 2001
Messages
27,167
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

Top Bottom