Please ! urgent... Update a total after deleting a row

Please ! urgent... Update a total after deleting a row

Hi,

Thanks to you folks, I'm now able to have a total in the main form that sum values from a subform. This part works fine.
But there's still a minor problem I can't solve: if the user delete a row with a value in it from the subform, the total is not updated. It seems logical, given that there's no "user input". 
So I tried to apply the same script on "on delete row" but nothing happens. Any idea ? 

Here is my script:

temp_total = 0.0;
for each x in FPA1
{
    if (x.Montant  !=  null)
    {
        temp_total = (temp_total  +  x.Montant);
    }
}
input.TFPA1 = temp_total.toLong();