Solved

Resetting Auto number ID column

Posted on 2008-06-15
4
556 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

717 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