Solved

Add an autonumber field in Access with existing data

Posted on 2014-10-10
2
242 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 35

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

Suggested Solutions

Title # Comments Views Activity
SSRS 2012 r2 - Parm Drop Down has Date/Time 12 31
sql server computed columns 11 30
Exporting Access Tables as CSV 3 23
T-SQL: New to using transactions 9 22
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 …
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
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…

776 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