PDA

Click to See Complete Forum and Search --> : Reset Access Autonumber field


KGComputers
Jan 26th, 2006, 07:56 PM
Hi,

My client wishes to delete all previous record in the database....The last record number is 241 which corresponds to the last order made..Is there a way to reset the autonumber default value back to 1 once I delete all the records and start with a new record?

The field name is OrderNum(data type is: autonumber).

Hope you get my point....

:) :) :) Greg

RobDog888
Jan 26th, 2006, 07:59 PM
The first way I know is to perform a Compact & Repair on the database. This will reset the seed to the next number after the last record's autonumber id value.

KGComputers
Jan 26th, 2006, 08:15 PM
Hi.....

Thanks for the prompt reply...Yup, it did work...

However, are there any VBA coding applicable to this w/o using the compact and Repair Method?

:) :) :) Greg

RobDog888
Jan 26th, 2006, 09:57 PM
You can programmatically perform a C & R on the db but exclusive access is required.

Here is another way:
http://office.microsoft.com/assistance/hfws.aspx?AssetID=HP051887741033&CTT=1&Origin=EC010227011033&QueryID=8wp8ZJAZs0&respos=1&rt=6