Need help getting SUM from a subform

  • Thread starter Thread starter anna
  • Start date Start date
A

anna

I have a form called JOB, with a subform called MATERIALS

The MATERIALS subform allows the user to enter various lenghts and
widths. I have a calculation in a text box which then uses that
information and a queried cost to calculate a "price per piece". Right
now this is a calculated value and not stored in a table.

I want the main form JOB to show the total of "price per piece". I can
do a DSUM if the values are in a table but they are not.

How do I place the "price per piece" into a table? Or is it possible to
sum values that are not stored?
 
Anna,

It is good that you are not trying to store the calculated value in a
table, as doing so would probably be incorrect.

Probably the easiest approach would be to put an unbound textbox,
hidden if you like, in the Footer of the subform, and use the Sum()
function in its controlsource to total the calculated field. Then you
can refer to this control in another unbound control on the main form,
using syntax in its controlsource such as...
=[Materials]![NameOfTotalsTextbox]

- Steve Schapel, Microsoft Access MVP
 
Back
Top