Solved

Resetting Auto number ID column

Posted on 2008-06-15
4
537 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

822 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