How to add a value to an autonumber field?

vid

Registered User.
Local time
Yesterday, 20:19
Joined
Feb 4, 2010
Messages
62
Hi!

I have a database which already has a lot of data. However my I need to add in a record for Warranty ID (which is an autonumber field) = 29. How can i do this?
Please help.. I don't want to delete all data and key it in all over again!!!
 
Why do you need to add a value to an AutoNumber field? The whole point of an AutoNumber field is that it Automatically generates a unique (not necessarily consecutive and not necessarily positive, just unique) numeric reference number.
 
yeah i know, but the problem is that i need to add the old data into this database too. For those some specific value already exists.. So its a pain adding those records if i'm gonna have to empty everything and add again...
 
Why not simply import your master data from the old DB. Let you current DB assign an AutoNumber to it, then update your Foreign Keys (FK) in the child data then import that?

Of course you are going to need some temporary fields to allow you maintain your old referential links.
 
You should be able to add a specific value as part of an append query:

INSERT INTO TableName(IDField, OtherField)
VALUES(29, Whatever)
 
Ohhh!! Thank you sooo much... :)
 
No problem. As John said, it's normally not needed or even a good idea, but there are those times when we need to do it.
 
You should be able to add a specific value as part of an append query:

INSERT INTO TableName(IDField, OtherField)
VALUES(29, Whatever)
Paul I forgot about that. I was importing some text files with autonumber fields recently and had to implement the Dictionary object. It was pretty quick as well.
 

Users who are viewing this thread

Back
Top Bottom