Results 1 to 12 of 12
  1. #1
    merlin777 is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Sep 2011
    Posts
    117

    stupid question about auto numbering in a new table

    When I create a new table, access automatically adds an auto number field labelled ID. How come it always starts at 2?

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    I thought it always started at 1, but that does not matter. If you want it to start at another number, you can run an append query and write to the Autonumber field. There are a couple caveats. I believe it is as simple as not duplicating any Autonumber field that currently exists. I follow the rule of starting with a number that is greater than the largest number that existis in the table.

    You can do a compact and repair to "reset" any reserved autonumbers that are not visible within the table. For instance, you create a record but do not commit it to the table or you delete the record. If that record had an Autonumber of 5, the number 5 will not be available unless you did a compact and repair, first.

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Odd, mine always start at 1.

    The missing number will be available and used after C&R if no other records were entered first.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Perhaps you have some attribute set -- it usually starts at 1 unless changed to a specific starting value or random assignment. Be cautious of autonumber, they are not necessarily incremental and not necessarily positive. They are only "guaranteed" to be unique.

    See this for more info about autonumbers.

  5. #5
    merlin777 is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Sep 2011
    Posts
    117
    in case I'm being thick I'll upload an image. All new tables seem to do this.
    Click image for larger version. 

Name:	Screenshot 2015-09-28 20.23.12.png 
Views:	8 
Size:	15.8 KB 
ID:	22192

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    We did not doubt you but never seen this happen and no idea why. AFAIK, would have had to delete record with ID 1.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #8
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    I did not doubt your records are starting with 2. Is this not acceptable?

  9. #9
    merlin777 is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Sep 2011
    Posts
    117
    I added the screen shot just n case I hadn't understood or described what was going on properly...

    and well blow me down - I just created another one and this happened:
    Click image for larger version. 

Name:	Screenshot 2015-09-28 21.02.11.png 
Views:	8 
Size:	35.5 KB 
ID:	22193
    I think you may be right about the deleting. I can't remember doing it but I'll keep an eye open for it.

  10. #10
    merlin777 is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Sep 2011
    Posts
    117
    starting with 2 is fine. I was just curious, as I'm a novice, as to why it didn't do what I expected it to. When I just tried it and it did exactly what was expected it made me even more confused!

    I'm heavily into excel and I'm finding the conversion to access a bit tougher than I expected. It's like living in a 2D world and suddenly finding yourself in a 3D world! Thank goodness I can ask you guys.

  11. #11
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Access definitely has its nuances, but it does a lot for us so I try not to complain about how it behaves. I just try to remember what it likes to do.

    For me, I probably would not have noticed 2 being a first record. If it was very obvious to you, you might want to review the link provided by orange in post #4. Just so you have a good idea when and how to use the Autonumber data type.

  12. #12
    merlin777 is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Sep 2011
    Posts
    117
    thanks everyone.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Total Noobie here... question about auto numbering
    By JavaBeans in forum Database Design
    Replies: 10
    Last Post: 04-25-2012, 04:58 PM
  2. Maybe a stupid question
    By rbiggs in forum Programming
    Replies: 1
    Last Post: 08-23-2011, 05:29 PM
  3. Stupid Question
    By ellixer in forum Queries
    Replies: 1
    Last Post: 06-30-2011, 09:33 AM
  4. Stupid Question ?
    By nood in forum Forms
    Replies: 3
    Last Post: 09-29-2010, 07:54 AM
  5. newbie has stupid question
    By Bruzer in forum Access
    Replies: 3
    Last Post: 04-05-2010, 12:03 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums