i need a column similar to the autonumber column in a table. However i would like it to cycle through a certain amount of numbers and then begin repeating itself...
It can be done, but you will have to construct the "autonumbering" yourself.
Start with a new tabel (tabel1) with one filed and post, this will hold the curent number. Then whenever you add a post you just get the number from tabel1 and after that increamnt it with 1 (add 1 to the number).
Every time you have created a post with the "highest" number you reset the number in tabel1.
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.