View Full Version : Report Long Calculation for Mulitple Records


james_IT
12-14-2009, 05:04 PM
Hi

I have a report with a few hidden textboxes because they are controls for a long calculation. However in the report every record shows the same calculation when it shouldnt...

Im trying to create a report for multiple records.

My calculated textbox is:

=Sum((([txtLFeet]*0.3048)+([txtLInches]/12*0.3048))*(([txtWFeet]*0.3048)+([txtWInches]/12*0.3048))*[CV Code])

I know the calculation is correct because it works in a report based on ONE RECORD however it just repeats the same answer for all records...

Any ideas?

Galaxiom
12-14-2009, 05:09 PM
Access is working exactly as designed.
Calculated controls use the values of the current record.

You need to derive your calculations as fields inside the record source query using the values from the table fields rather than values from bound controls on the report.

james_IT
12-14-2009, 05:14 PM
Access is working exactly as designed.
Calculated controls use the values of the current record.

You need to derive your calculations as fields inside the record source query using the values from the table fields rather than values from bound controls on the form.

So my calculation need to go in the query? Where and how do i insert it?

james_IT
12-14-2009, 05:25 PM
Access is working exactly as designed.
Calculated controls use the values of the current record.

You need to derive your calculations as fields inside the record source query using the values from the table fields rather than values from bound controls on the form.

So my calculation need to go in the query? Where and how do i insert it?

Galaxiom
12-14-2009, 06:23 PM
Type the expression into the field box of the query designer.
Change parts that refer to control names to refer directly to the table.field names in the underlying tables.

This will make another field in the query called Expr1.
You can edit this name.

Then you can insert a bound control on the report and set its Record Source to the new field.

Rich
12-14-2009, 11:16 PM
=Sum((([txtLFeet]*0.3048)+([txtLInches]/12*0.3048))*(([txtWFeet]*0.3048)+([txtWInches]/12*0.3048))*[CV Code])


Should be
=([txtLFeet]*0.3048)+([txtLInches]/12*0.3048)*([txtWFeet]*0.3048)+([txtWInches]/12*0.3048)*[CV Code])