Scripts for multiple subforms

Scripts for multiple subforms

Hi,

I have multiple subforms in a form and want to sum up the score fields in each one.

I am using this script

b = 0;
for each row in input.General
{
    b = (b  +  row.Score);
}
input.General_Score = b;

c = 0;
for each row in input.Hygiene
{
    c = (c  +  row.Score);
}
input.Hygiene_Score = c;

But I get error 

Variable 'row' is already defined of data type 'ZC_SUBFORM_85' but trying to update 'ZC_SUBFORM_60' data type

Any help is appreciatted

Ant