Sequential numbering
I“m trying to get each entry on a suitable to be numbered 1-2-3 etc each time a new instance of the subtable is created. So, the main table represents a ”Job“ and each entry on the subtable represents a ”visit“ (numbered sequentially).
8 replies
-
this is just one way to do it - other will advise you of other methods
in the trigger on create of the subtable myJobs) assuming your subtable (child) is MyJobs
and the number field wher to numbering is to increment is called something like “Job Bag No”
enter this script
let before := max((select MyJobs).“Job Bag No”);
“Job Bag No” := before + 1“Job bags No” needs to be a number field
Then when you creare a NEW entry it will auto number
after the plus + you can put any value in steps ie 2 or 6 etc
Note: if it does not appear to work add the first number manually into the first record ie 0 or 1
Mel
-
heres mine in one of my forms
and here is the result
-
-
dunno why the screen shots not loaded - never ever done that before but you get the idea from the script
-
-
Nope def broken !!!
-
Thanks for the reply. Unfortunately, the numbering increments from a “global” position (not from “1”) per instance of subtable creation. I“d appreciate some more ideas!
Content aside
- 3 yrs agoLast active
- 8Replies
- 595Views