Incrementing numbers on Add Row, based on value in previous row (in a SubForm)

Incrementing numbers on Add Row, based on value in previous row (in a SubForm)

Hi there,

I'm building an inventory/order system (yes, yet another onw :-) and when we receive goods, we add serial numbers to them.

I will often get 20-30 new items with running numbers and I'm looking for a way to automatically increase the serial number for each new row I create... so something like

if (row[-1].S_N != null)
{
    row.S_N = row.[-1].S_N+1;
}

Can this be done ?

Cheers,
David