Larsson- great idea, just you have a lot of overhead by creating that secondary table just to hold onto one value in one record.
Storing a Custom Property in the database object would keep your database smaller (in more ways than one).
A custom database property doesn't care about Compact- tables love to be compacted- alot. Then again, if you're only modifying the field, and not deleting/adding new 1field records, then I don't believe it would grow. Still, a table's a table, and just the meta-data behind it can hold a significant amount (if you care about keeping things small).
For more information on creating a custom property, you should be able to use the example in Help, with a few minor modifications- use the index tab and type in "CreateProperty method", and check out the "EXAMPLE". You should be able to make a few changes to the given code, and throw it into a Module. Then just call your own custom setDBProperty and getDBProperty functions.
getDBProperty, when you're creating a new record. Increment it, compare the incremented number to the constraints of your upper limit and reset if neccissary, and then setDBProperty with the new number.
But- if you don't want to do too much VBA coding Larsson's idea is good too. If we all cared so much about keeping databases small, we'd all have chosen a different DBMS.
-MoGryph
[8O)