Adding totals in subform error

Adding totals in subform error

Hello

I am trying to add qty's in subform

When I add a new line in the subform I am getting the following error



The below is the code I am using

input.Total_Training_Cost = 0.0;
for each  line in input.Attendee_Signature
{
 input.Total_Training_Cost = input.Total_Training_Cost + line.Currency;
}

Thank you for any help you can offer

Kind Regards

Amanda