I need to create a very small DB with a handful of categories and < 50 entries, each generating a–unique–random small number. I don’t really need a form to create the categories, but it would be nice to have a form to create the entries; for the latter the only thing I need is to select a category then for the DB to give me a random–unique–number, hopefully from 00 to 99. I suspect simply setting the field to be random & unique number to unique then somehow have it be automatically generated to something random wouldn’t be sufficient, that if what’s generated is already assigned it would yield an error and leave the user with little recourse, if so that would require a way to handle such cases, perhaps by either
- generating a random number, or
- incrementing the number in a manner it would cycle back to the minimum when it reaches the maximum (eg 98, 99, 00, 01, …),
then trying again to save, and if that fail repeat (whichever #1 or #2 was chosen).
I have no idea how to proceed, would you kindly help with that? I’ve created the example
category_random_number.odb (3.3 KB)
, which the number to be random and unique is the field Label from the table Samples.
Thank you