Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help! Reset Auto number in table back to 0 3

Status
Not open for further replies.

RDM23

Technical User
May 16, 2007
39
US
I have a table that I deleted all the records out of. The autonumber field continues to count from the previous deleted records. How can reset the "autonumber" ID field back to 0 in this table? Thanks in advance for your help.
 
Tools -> Database Utilities -> Compact and Repair Database...


-V
 
That didn't reset the tables auto id field back to 0. Any other options?
 
run this code
currentdb.Execute "insert into tablename (idfield) value (1)"

after that run compact and reapair
 
My bad, the Repair and compact did work that VRoscioli suggested. I just had to clear out the table first. Thanks for all your help. Issue resolved.
 
Or execute an action query like this:
ALTER TABLE yourTable ALTER COLUMN yourAutoNumField COUNTER(1,1);

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top