delete query on table and reset autonumber

  • Thread starter Thread starter cporter
  • Start date Start date
C

cporter

I have a table that I populate with a series of queries. It gets erased
and repopulated each time the queries are run. The table has an
autonumber field that I need to start at 1 each time it regenerates.
What's the best way to do this?
 
I have a table that I populate with a series of queries. It gets erased
and repopulated each time the queries are run. The table has an
autonumber field that I need to start at 1 each time it regenerates.
What's the best way to do this?

Not using an Autonumber.

Autonumber fields have one purpose, and one purpose only: to provide a
guaranteed-unique key value. There's NO guarantee that they're
sequential, gapless, or start at any particular point.

You'll probably need to write VBA code to assign sequential numbers to
a Long Integer field.

You can instead *try* Compacting the database after every time you
empty the table, but even this might not work.

John W. Vinson[MVP]
 
Back
Top