Autonumber changing???

winkmich

Registered User.
Local time
Today, 03:32
Joined
Jun 21, 2002
Messages
18
Hello there,

I have a table with about 5000 records. the last record has the ID 7852 (this field was given the primary key and is of autonumber format.)

If I want to add a new record, the next ID is given 7853 - as expected.

In order to change the structure of the table I copied it (simple Copy-Paste command). When adding a new record into the copied table, the next ID is given 13153.

For some reason the ID field is adding 5300.

Has anyone had similiar experiences?
It is completely strange, since I haven't done any other changes to the table.

Thanks in advance, Michael.
 
Hi

I think you'll find that the autonumber is remembering the old latest number and adding the records again to itself in the new table.

What you need to do is to re-set the autonumber.

Look at Access help under "Change the starting value of an incremnenting AutoNumber field"

It explains in good detail what you need to do.

Don't forget to check that the numbers are ok in the new table.

Hope this helps

Col
:cool:
 
Autonumber re-setting

Thanks for your help ..

Actually I followed the instructions of "Change the starting value of an incrementing AutoNumber field".

When proving the result of the with the Datasheet View it look okay. But when I press the "!"-button a warning appears:

"The INSERT INTO statement contains the following unknown field name: 'ContactsID'. make sure you've typed the name correctly, and try the operation again."

Does anybody know what the problem might be??

Thanks in advance. Mike.
 
Relying on autonumbers to be sequential is setting yourself up for a fall

All the Autonumber is designed to do is give you a unique identifier. It makes no claims that it will be sequential, or remain so. Lots of things can make you miss a number: Append Queries (even when you cancel running them!), Copy Paste, Deleted Records, Cancelled Records... However it will always, uniformly, be unique.

If you need a sequential field in your database, you're going to have to make it yourself or enter the values by hand. Look up DMax to get an idea of how to proceed on this, and check the archives for topics about 'sequential dmax field'.

Good luck,
David R
 

Users who are viewing this thread

Back
Top Bottom