?
Solved

Add an autonumber field in Access with existing data

Posted on 2014-10-10
2
Medium Priority
?
264 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
[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
2 Comments
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 2000 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 38

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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
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…
Suggested Courses

777 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