Expand my Community achievements bar.

Calculate sums from two subforms/tables in a third

Avatar

Level 1

Hi,

I've created two tables in two separate subforms that show funding by year (in the columns) and by phase (in the rows). They are identical though users will enter different information. I've written FormCalc scripts to sum the rows and columns of each.

Now I'd like to create a third table (in a third subform...I guess) that sums the information from the other two tables. For example, the field in the third table that shows total funding for design in FY2011 would sum the funding in FY2011 from federal (table 1) and local (table 2) sources.

Can this be done in FormCalc? I tried the formula:

     Sum(FederalFundingSubform.FederalFunding.Row2.FY2011 + LocalFundingSubform.LocalFunding.Row2.FY2011)

Where "FederalFunding" and "LocalFunding" are the first and second tables.

I got the error messages "accessor 'LocalFunding.Row2.FY2011' is unknown" and "accessor 'LocalFunding.Row2.FY2012' is unknown" which implies I don't have the references right.

Any ideas? Thanks.

1 Reply

Avatar

Level 10

The easier way to get the correct reference to the field is to place a messagebox script in the exit event.

Try place the following script in the exit event and see how the control is being referenced and then change your script accordingly.

     $host.messageBox($.somExpression); //(Form Calc)

Thanks

Srini