Results 1 to 6 of 6
  1. #1
    CHEECO is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2016
    Posts
    156

    Setting Table Auto Number back to zero

    I have a number of tables that have fields that are Auto Number fields and I would like to set them back to zero. I have deleted all the records in the tables but it still wants to carry of from the last previous number. I would like it to start over again at zero. Is there an easy way of resolving this problem. Thank-you.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Have you done a Compact and Repair yet?

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,850
    When you delete the records from all of the tables involved, run a Compact and Repair. That should reset the autonumbers.

    Oooops I see Allan has responded.

  4. #4
    knarfreppep is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Feb 2015
    Location
    Adelaide, Australia
    Posts
    106
    Set dbDatabase = DBEngine.Workspaces(0).OpenDatabase(gcPATH_DATA & gcDATABASE_NAME_DATA)
    dbDatabase.Execute "ALTER TABLE tblTable ALTER COLUMN lngID COUNTER(0,1)"

  5. #5
    CHEECO is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2016
    Posts
    156
    Compact and Repair. That solved the problem Thank-you very much.

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You're most welcome and thanks for marking the thread as Solved.

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

Similar Threads

  1. Changing Table ID/Auto Number Format
    By PATRICKPBME in forum Database Design
    Replies: 11
    Last Post: 08-03-2017, 01:01 PM
  2. Replies: 12
    Last Post: 12-03-2013, 10:31 AM
  3. Replies: 4
    Last Post: 05-21-2012, 08:21 AM
  4. Table auto number issue when getting to 10000
    By shabbaranks in forum Access
    Replies: 11
    Last Post: 05-18-2012, 10:14 AM
  5. Replies: 1
    Last Post: 02-05-2009, 04:53 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