views:

679

answers:

2

Is there any way to change the autonumber field to a number datatype, when the field is used a primary key and linked to other tables?

A: 

As far as I'm aware there's no way to change this. In Access 2007 it can be changed from Long Integer to Replication ID. In previous versions I don't recall any way of doing this - if I recall correctly it was automatically set to Long Integer but there's no way to control what Access does with the AutoNumber.

Edit (question modified): You'll have to drop the relationships with the other tables in order to modify it, once you've dropped the relationship you'll be able to change the type and then recreate the relationship.

BenAlabaster
+2  A: 

You will have to delete the relationship(s) between the table and any foreign key columns on other tables first. Change the data type and then recreate the relationship(s).

John Mo
I knew that, but hoped for an easier way. Thanks.
lamcro
If you have a lot of relationships to handle, you can automate the process of removing and replacing the relationships using VBA and DAO; but probably not worth the trouble unless it's going to be a recurring task.
John Mo