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!

Resetting Auto-number

Status
Not open for further replies.

DropsIT

MIS
Jun 12, 2003
37
GB
Is there a way of resetting the autonumber on a data table after clearing down all the records ?
 
Simply compact and repair the DB.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Not a bad idea but the process that I'm running uses the same table each time and therefore I have to rest the autonumber within the database prior to running the sequence of processes. I did think of deleting and then using a 'Make table' to recreate it only this would loose some of the parameters in the table fields that I need.
Is there a VB script to reset the autonumber on a specific table ?
 
CurrentDb.Execute "ALTER TABLE myTable ALTER COLUMN myID COUNTER(1,1);"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top