Totals Not Working

  • Thread starter Thread starter Kevin Sprinkel
  • Start date Start date
K

Kevin Sprinkel

On a continuous form based on tblTakeoff that calculates
the weight and surface area of structural steel,I have the
following controls:

Control Name Control Source
============= ====================
txtFormula Formula
txtQty =Eval(Nz([txtFormula],0))
txtMultiplier Multiplier
txtTotalLF =[txtMultiplier]*[txtQty]
txtLBperLF LBperLF
txtSFperLF SFperLF
txtTotalLB =[txtTotalLF]*[txtLBperLF]
txtTotalSF =[txtTotalLF]*[txtSFperLF]

The basic form is working.

I would like to total the last two controls in the form
footer. I constructed the following formula for the first
summary control:

=Sum(Eval(Nz([txtFormula],0))*[txtMultiplier]*
[txtLBperLF])

This generates an error. Simplifying the expression to
try to isolate the error also generated errors on the
following expressions:

=Sum([txtMultiplier])
=Sum([txtLBperLF])
=Sum(Eval(Nz([txtFormula],0)))

Clearly I'm missing something basic to using the Sum
function. Can anyone help?

Kevin Sprinkel
 
Hi Kevin
It appears as if you are not summing anything, but
multiplying those three values. Am I missing something?

Hope This Helps
 
This generates an error. Simplifying the expression to
try to isolate the error also generated errors on the
following expressions:

=Sum([txtMultiplier])
=Sum([txtLBperLF])
=Sum(Eval(Nz([txtFormula],0)))

You can't sum *controls on a form* - only *fields in a query*.

If you move your calculations into calculated fields in the Form's
Recordsource query, instead of the control sources of textboxes, your
sums should work.
 
Art,

Thanks for your response. I'm trying to sum the results
of the calculation. I can't refer directly to txtTotalLB,
according to Access Help, since it is a calculated
control, i.e.,

=Sum([txtTotalLB])

also generates an error. I'm baffled.
-----Original Message-----
Hi Kevin
It appears as if you are not summing anything, but
multiplying those three values. Am I missing something?

Hope This Helps
-----Original Message-----
On a continuous form based on tblTakeoff that calculates
the weight and surface area of structural steel,I have the
following controls:

Control Name Control Source
============= ====================
txtFormula Formula
txtQty =Eval(Nz([txtFormula],0))
txtMultiplier Multiplier
txtTotalLF =[txtMultiplier]*[txtQty]
txtLBperLF LBperLF
txtSFperLF SFperLF
txtTotalLB =[txtTotalLF]*[txtLBperLF]
txtTotalSF =[txtTotalLF]*[txtSFperLF]

The basic form is working.

I would like to total the last two controls in the form
footer. I constructed the following formula for the first
summary control:

=Sum(Eval(Nz([txtFormula],0))*[txtMultiplier]*
[txtLBperLF])

This generates an error. Simplifying the expression to
try to isolate the error also generated errors on the
following expressions:

=Sum([txtMultiplier])
=Sum([txtLBperLF])
=Sum(Eval(Nz([txtFormula],0)))

Clearly I'm missing something basic to using the Sum
function. Can anyone help?

Kevin Sprinkel
.
.
 
Thanks, John--you are the best! It makes so much more
sense to do all these calculations in the query anyway.

I was led astray by the online Help which says to change
the Control Source to use the sum function with
an "expression", defined as:

any combination of mathematical or logical operators, ...
and names of fields, *controls*, and properties that
evaluates to a single value ...

Best regards.
Kevin Sprinkel
 
Back
Top