Need help getting SUM from a subform

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?
 
S

Steve Schapel

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top