restart autonumber from 1, programmatically

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

At the end of the year I have some 2003 Access tables that need to be cleared
and have the autonumber index start all over at one. clearing is easy after
running a delete query but I am not sure how to programmatically start the
count all over at one. I want the user to press a button and the attached
tables will clear and reset (I can take care of the dangers of a file being
open, etc.) Can you help?

thanks so much, in advance..........
 
Bill Brinkworth said:
At the end of the year I have some 2003 Access tables that need to be
cleared
and have the autonumber index start all over at one. clearing is easy
after
running a delete query but I am not sure how to programmatically start the
count all over at one. I want the user to press a button and the
attached
tables will clear and reset (I can take care of the dangers of a file
being
open, etc.) Can you help?

thanks so much, in advance..........


If you mention attached tables, I guess your database is split. In that
case you would have to delete all entries in the back end and
programatically compact and repair. Other options are to delete the table
and import a blank one, or re-create the table using DAO code. Or perhaps
you could keep a blank database somewhere and simply delete the old one and
replace with a blank one. I don't know what might suit you best - there has
been code posted for all of these options.
 
Back
Top