delete autonumber memory

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
 
M

Marshall Barton

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.
 

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