Solved

Add an autonumber field in Access with existing data

Posted on 2014-10-10
2
251 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 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 36

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

696 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