delete autonumber memory

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

Guest

After a delete query that deletes all the data in a table, I also need the
autonumber (key) reset to zero. It just keeps counting up forever. After it
gets in the 6 digit numbers it messes up my code that uses that field as part
of a file name format 0000.
Is there a way to reset this counter on the autonumber field programmatically?
thanks,
ck
 
Charlie said:
After a delete query that deletes all the data in a table, I also need the
autonumber (key) reset to zero. It just keeps counting up forever. After it
gets in the 6 digit numbers it messes up my code that uses that field as part
of a file name format 0000.
Is there a way to reset this counter on the autonumber field programmatically?


After you delete the records, Compact the database.

OTOH, there is no good reason why you should care about the
value of an autonumber field. Autonumbers are only good for
creating surrogate keys and should never be displayed. If
no one can see it, then there is nothing to complain about
the values.

If you need to provide a sequential number for something
like invoice numbers, then create you own values instead of
using Autonumbers.
 
Back
Top