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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Autonumber 2

Status
Not open for further replies.

durug

Technical User
Mar 22, 2002
335
CA
Hi!

I have a column of autonumber type. I tested the application, so the autonumber field got to the value 24.
Now I would like to send the application to the client and to remove the test data from the tables.

How to I make the autonumber to start again from 1.

Thanks,
Durug
 
Basically, you need to do the following:

I)Create a temporary table with one field, of type Long Integer, & give it the same name as the autonumber field in the original table.

II) Enter a value in this temp field, 1 less than the starting value you require in your original table.

III) Create an append query to append the temp table to your original table & run it (but you must remove any Required properties, any index properties set to Yes(no duplicates) and any ValidationRule properties from your original table before running it).

IV) Delete the temp table.

V) Delete the new record which was appended to you original table.

VI) Re-apply the properties you removed from your original table in step III)

The first record you now add to your original table will now start at 1 more than the value you appended when you ran the query.
This info is in the Access help file, if you search for 'change start value autonumber'

Hope This Helps! :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top