View Full Version : How can I change the number of digits for my primary key


mlamont
06-20-2002, 10:51 AM
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
06-20-2002, 11:02 AM
Put "000000" (without quotes) in the Format property of the field in the table.

The_Doc_Man
06-21-2002, 10:17 AM
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.