Changing Data Type

ahennema

New Member
Joined
Sep 14, 2005
Messages
27
I was asked to look at somebody elses Access 2002 DB with a request to change a field "Req Nbr" which is an auto-number field to a non-autonumber field so the user can fill in their own values. Also the field is a Key field used to link to another table.
Can I change the field type to just number? When I attempt it says I can't change it without dropping the link. Could I drop th link, change it and then relink it?
 

boblarson

MrExcel MVP
Joined
Nov 14, 2008
Messages
1,964
Someone asking to change the PRIMARY KEY to something someone CHOOSES to fill in? Personally I would tell them that they are NUTS! That is an ATROCIOUS idea. It is okay to have an EXTRA field if you want a special number but they shouldn't even be concerned with what the primary key is. The primary key is what keeps the links between the data and helps maintain referential integrity. It really should just be something that is hidden and the system uses. At least that's my take on it.
 

revans

Well-known Member
Joined
Apr 5, 2010
Messages
576
Can you drop the link, change the datatype to number, then relink? Yes. Should you? NO!

Without talking about the possibile ramifications of someone hand changing the number on the new (or even old) records, there will proably be some part of the db that relies on automatic insertion of that number for the db to work properly. All kinds of things could break.

Add a new field like boblarson recommends and leave the auto field be.

hth,

Rich
 

Forum statistics

Threads
1,082,570
Messages
5,366,364
Members
400,886
Latest member
Fchel

Some videos you may like

This Week's Hot Topics

Top