Solved

Add an autonumber field in Access with existing data

Posted on 2014-10-10
2
237 Views
Last Modified: 2014-10-13
Greeting,

I have data in an Access 2007 table. How do I add an auto-number field to it and make the number start with 000001?
Thanks.
0
Comment
Question by:mrong
2 Comments
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Access MVP) earned 500 total points
ID: 40374079
Since the Auto Number is a  Long Integer, there will not be a any leading zeros. You can use the Format property in the Field in the Table to make it 'look' that way, but it will be stored w/o the leading zeros.

If you add a new AN field to your table, it will automatically start at 1

mx
0
 
LVL 34

Expert Comment

by:PatHartman
ID: 40377100
The autonumber is a tool used to allow you to define an arbitrary surrogate key.  It is NOT meaningful data.  Therefore, it doesn't matter where it starts although as Joe indicated, a new autonumber will start with 1.  Autonumbers always develop gaps over time.  The only thing they are useful for, aside from their stated purpose of unique identifier, is to show the order in which rows were added to the table.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
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.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

758 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

17 Experts available now in Live!

Get 1:1 Help Now