Changing Field data type

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top