Populate field with numbers in sequence starting form the given number

So i have a field {EDU_ID} in a database that needs to be populated with a number in sequence.

I wan’t to give it a start value of let’s say 1000 and depending on the value in another field {EVENT_ID} it has to fill the {EDU_ID} with an incrementing number starting from the given value

so i have 800 records with the same id in {EVENT_ID} and like to populate the field (EDU_ID} with numbers in sequence starting form the given number

like

1001
1002
1003

i tried a lot with varies resluts but no clean script in SC to do this. any suggestions.

because this type of action is repeatedly done by a user with a different start number i mange this with SC instead of once in SQL in the database

so i put this in onrecord of a grid

static $a = 1000;
echo $a;
{EDU_ID} = $a;
$a++;

and the fields EDU_ID is nicely populated but i wan’t the number 1000 to be an input field (read global) that i can set. any suggestions?