Solved

Resetting Auto number ID column

Posted on 2008-06-15
4
520 Views
Last Modified: 2013-11-27
Greetings Experts,

I don't think this should be a difficult thing to do but I can't seem to figure it out: I have a table in an Access database and because of several script tests, I have a lot of test records that I've had to delete.   Even though I've deleted these test records, the autonumber ID column continues to assign the culmulative total of all records ever created i.e. I've run 17 tests, deleted all 17 records, run another test and the autonumber ID column starts number from 18.

How do I reset the autonumber column ID so it starts numbering records from 1 after running and deleting these test records?  I hope that was clear and thanks for the help!
0
Comment
Question by:max7
4 Comments
 
LVL 3

Assisted Solution

by:darkmooink
darkmooink earned 125 total points
ID: 21790173
the way i have done it in the past, although I don't believe it is the easiest or best way of doing it, is by deleting the column and then recreating it.
0
 
LVL 30

Assisted Solution

by:hnasr
hnasr earned 180 total points
ID: 21790385
To start autonumbering.
1 Create a new table
2 Append old table to new one
3 Delete old table
4 Rename new table to old name.
0
 
LVL 58

Accepted Solution

by:
harfang earned 195 total points
ID: 21790584
When you use (Tools | Database Utilities | Compact and Repair Database...), all empty tables get their counter reset to 1. In past versions, it would also reset non-empty tables to the highest value plus 1, but that is no longer true.

(°v°)
0
 
LVL 1

Author Closing Comment

by:max7
ID: 31467435
So it's not so straightforward after all - I don't feel as bad now!  Thanks to all of you for the excellent guidance.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now