Action on Add Row for a sub form

Action on Add Row for a sub form

Hi,

When adding a row to a sub form, how can I asign a value to one of its fields using information in the curent form? There is an option to do actions "on Add Row" but the problem I have is that it only changes the first row rather than the row being added.

Below is the code I am using, which results in updating allways the first record of the subform..

input.SKU_Ultimo = (input.SKU_Ultimo  +  1);
SKU.SKU = input.Numero + "." + input.SKU_Ultimo;

thanks for your support...