Restart numbers from 1 after deleting records in ID Field

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Aftab Ahmad
    New Member
    • Jan 2015
    • 49

    #1

    Restart numbers from 1 after deleting records in ID Field

    I have some records e.g. 150 in my table "Cases". After deletion all records, I want to start numbers from 1 to onward in "ID" field. How it possible?
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32669

    #2
    It's never a good idea to design your system so that what the numbers are matters.

    That said - there are a couple of ways to achieve this :
    1. Delete the records then Compact and Repair the database they're held in.
    2. Copy the table and Paste it back using a new name and selecting the option Design Only.
      Delete the original table and rename the new one to replace it.

    Comment

    • zmbd
      Recognized Expert Moderator Expert
      • Mar 2012
      • 5501

      #3
      2nd that Neopa - with that said... sometimes after development I do like to start the tables out from scratch :)
      My workaround for that is to create the table structures in the split backend... make a copy of that... and use the copy for my development work.

      Aftab Ahmad : is this an "autonumber " field?
      if so then you have this option (building on Neopa's)

      ONCE AGAIN... this is NOT the recommended approach to database design - use at your own risk, I suggest making a backup first!
      How to reset an AutoNumber field value in Access

      Comment

      Working...