I have a database which is used once a year, and after use the main record is deleted. Each year the ID Autonumber carries on from the previous year. But this year the ID reverted and started from 1, its not a problem but I am curious why.
I have a database which is used once a year, and after use the main record is deleted. Each year the ID Autonumber carries on from the previous year. But this year the ID reverted and started from 1, its not a problem but I am curious why.
autonum field always picks up where it left off.
if you empty the table, then compact the db, It resets to 1.
I certainly emptied the table, but as for compacting it the procedure was the same as previous years so why it compacted I don't know. Anyway, thank you for your help.
If you are deleting data often, it is actually recommended that you Compact the database from time-to-time to reduce database bloat.
When you delete data, it does not actually reduce the size of the database until it has been compacted (the data is really still there behind the scenes and just marked for deletion until you do).
The Autonum field is really just intended to guarantee a unique value within the data in the current table. If you want the field to have some other sort of meaning, you probably want to create a Custom ID field instead of using Autonum.
If you delete the key field, then add it back, it starts over at 1 also I believe.