How do I reset a primary key.
I am copying a database I use every year with new entries - the entry ID is getting unwieldy - so I want to restart with 1 again. How do I reset the primary key without disturbing the rest of the database.
Thanks
How do I reset a primary key.
I am copying a database I use every year with new entries - the entry ID is getting unwieldy - so I want to restart with 1 again. How do I reset the primary key without disturbing the rest of the database.
Thanks
Historically if you empty the table and then do a compact/repair, the autonumber gets reset. Worth a try anyway.
Is the PK an Autonumber???How do I reset the primary key without disturbing the rest of the database.
If yes, then read these:
Autonumbers--What they are NOT and What They Are
http://www.utteraccess.com/wiki/index.php/Autonumbers
Microsoft Access Tables: Primary Key Tips and Techniques
http://www.fmsinc.com/free/newtips/primarykey.asp
Use Autonumbers properly
http://access.mvps.org/access/general/gen0025.htm
(pay attention the the 3rd from the last paragraph that begins "If you need a meaningful sequencer........")
Hi Caroline,
resetting the primary key in a database is never a good idea. Generally you only use the primary key for connecting the data from several tables in a one to many relationship. Changing the PK might break-up that relationship. Normally, the end user never gets to see the content of the primary key field, they look at, for example, the customer number which is a separate, unique field.
From the information that you copy the database each year and start from fresh I get a bit the idea you're using Access as an excel workbook and not as a database system.
Greetings
Noëlla