View Full Version : Primary Key-Auto number - increment


desert emperor
02-12-2008, 11:38 PM
Hello ALL,

I want to know how to reset (to start again from 1) my primary key field. As an example i have the "Customers" table with the field "customerID" as PK now i entered many values (20) then i deleted them but i want to start again and the "customerID" value starts with 21 i understand that but i want a fresh DB (i was testing things) and i want to start from 1 can i? how? i even deleted the relation between this table and the other table but no success!

Some help please?

THX in advance

boblarson
02-13-2008, 12:11 AM
A couple of things -

1. You can delete all data from the table and then compact and repair and it will reset.

2. If your autonumber has meaning you are using the autonumber incorrectly. It should not matter if it is 1 or 2000000, an autonumber is ONLY guaranteed to give you a UNIQUE number and it doesn't guarantee consecutive, incrementing numbers.

boblarson
02-13-2008, 12:12 AM
Also, this might be of interest to you:

http://www.access-programmers.co.uk/forums/showthread.php?t=128935

desert emperor
02-13-2008, 12:21 AM
Well thx it was helpfull and new info for me

coastguard
02-15-2008, 04:40 AM
Thanks. It told me something I didn't realise