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

Auto Number resetting????

Status
Not open for further replies.

bnath001

Programmer
Aug 18, 2000
100
US
Hello,

I am developing an Access2000 database application and have fields of datatype "Autonumber". While developing the application, in the process
of testing when I insert records into the tables, the Auto number would have gone up to 1000.

Now I need to deliver the application to the client and
How can I reset the Autonumber to zero or initialize it so that the autonumber will start fresh.

thank you so much
nath
 
If you have designed this for a client, I'm sure you won't need any records in the table at start up, so what you need to do is delete all records from the table and copy and paste the table, with another name, back into the database. You can then delete the original table and rename the new table with the name it needs and re-establish any relationships required. I'm not sure if there is a different way to accomplish the desored result but this works and is really quite simple, less than a minute to complete. Michelle Fulton

 
Actually, you don't even have to do all that. When you compact the database, each table's Autonumber counter is set to one more than the last one used in any record in the table. If a table is empty, after compaction its Autonumber counter will be set to 1. Rick Sprague
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top