Changing Field data type

B

brownc923

I know that I have made an error, but would like to correct it. In some of
my tables I have set the Primary Key Field's Data type to "Number" when it
should have been "Auto Number." This is causing me problems when I try to
add new data records. Can I simply change the Data type to Auto number now
OR will that cause changes in the data already in the Field? - thus confusing
all of my relationships.
 
D

Douglas J. Steele

You cannot change the datatype to Autonumber once there's data in the table.

What you can do is create a new table, identical to the existing one except
make the field Autonumber. You can then create an Append query that takes
the data from the original table and puts it into the new table. That will
leave existing numbers as-is, and start numbering at 1 more than the largest
number in the table. Once you're satisfied with the new table, delete any
relationships to the old table, recreate them pointing to the new table,
then delete the old table.
 
Top