How to reset the auto numbering of a table via vba?

K

KS Wong

Dear all,

I've a table with a field using auto numbering feature. I want to clear the
table for data entry in production but the auto number is not reset to 0. Can
I reset the counter to 0 either manually or programmatically via vba?

Thanks in advance!

Best regards,
ks
 
R

Ron Weiner

Easy way is to remove all of the rows from the table then do a Compact /
Repair. Autonumber column start seed value is reset to zero.
 
G

Graham R Seach

If compacting the db doesn't work for some reason, simply append a record
(with a primary key = 0) to each table. Then delete the record. The next PK
number will be 1.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top