button to number records incrementally
I am trying to write script for a button in order to number a series of records. Here is the situation:
It is to give a candidate number for an audition.
I have a "Candidates" table with their details which I can filter to "chosen" and which are all in a year table of application. I have put a number field which is now empty so they can have a number once chosen.
In my "Year" table I show a view of the candidates, which I can of course filter into chosen and sort by age.
I would like to have a button that will start the first candidate at 1 and number through to the last "chosen" one in increments of 1. Not having much luck. I was thinking of using this kind of logic , but I'm not very good with the for/do loops:
let Y := Year;
(select Candidates where Year=Y and Filter="Chosen" order by "DOBirth").number +1
can anyone help? Do I put the button on the "year" table or its child table candidates?
2 replies
-
you can try something like:
let Y := Year;
let c := 1;
for i in select Candidates where Year=Y and text(Filter)="Chosen" order by DOBirth do
i.number := c;
c := c+1
endYou put the button in the table where the field Year is.
Content aside
- 8 mths agoLast active
- 2Replies
- 33Views
-
2
Following