Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Appending records into database with autonumber field.

Status
Not open for further replies.

JamieF

Technical User
Dec 1, 2000
10
0
0
US
Our database has an autonumber field as a key field. I need to append records into the database and then adjust the autonumber so that the next added record assumes the correct id number. I've tried following the instructions in the help files, which are basically to create a new table with only one field (that matches the autonumber field by name), remove the key indicator on the main table, set the value in the new table to the correct number, run an append query to update the main table... I've tried this several different ways, but I'm doing something wrong. The new record gets appended to the main database, but the autonumber doesn't ever seem to get corrected - it just increments itself by the number of records added. This incremented number would be ok, except for the fact that I'm actually deleting a bunch of records and putting in replacement records with the same id numbers. Does anyone have a fool-proof set of instructions to change an autonumber?
 
if you're familiar with recordsets, the most foolproof way to update your table is through a function.

if you're not familiar with them, e-mail me a copy and i'll write the code for you.

Psychpt@aol.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top