Share via

Reset a Primary Key?

Anonymous
2012-02-27T18:18:23+00:00

Hi all!

Is there a way to reset a primary key (autonumber) back to a starting number of 1?

Dave

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2012-02-27T19:34:13+00:00

Wipe it clean, delete all its records, clear.

Was this answer helpful?

0 comments No comments

7 additional answers

Sort by: Most helpful
  1. Anonymous
    2012-02-28T19:06:46+00:00

    I tried that and the primary key did not reset.

    If you have a primary key and then you had a relationship set then it may not reset with child records in the other table(s).  

    But you can try using my free database reset tool if you want to make it easier:

    I can't get the URL right now but it is in the Free Tools section of http://www.btabdevelopment.com.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2012-02-28T18:39:19+00:00

    I tried that and the primary key did not reset.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2012-02-27T18:39:21+00:00

    I have been doing a lot of testing and the primary key numbers are way high as compared to the amount of real data.  I was just wanting to reset that field back to match the amount of real data.

    What exactly do you mean by truncate?

    I'll chek out the link you sent.

    Dave

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2012-02-27T18:27:01+00:00

    My biggest question is why?  PK serve no purpose but to be unique.  You should not relly on them for anything beyond that.  If you need a sequential number... then you need to create your own Number field that you control and populate accordingly.

    The following post may be helpful and provide a few links worth investigating further: http://answers.microsoft.com/en-us/office/forum/office_2007-access/primary-key/eb3e2c0c-cd45-e011-90b6-1cc1de79d2e2

    To directly answer your question,

    If you truncate your table and perform a compact and repair, does that not reset your PK value to 1?

    Was this answer helpful?

    0 comments No comments