Sum()

J

JimS

I have a fairly simple form with a query as a control source. The query
includes two calculated columns. They work perfectly. When I change one of
the fields in the row that's part of the calculation, the calculated columns
recalculate and redisplay no problem.

My issue is that in the header (and footer) of the form, I have a text box
whose control source is simply sum(TotLabor), where TotLabor is one of the
displayed calculated columns. I've changed the name of the text box for that
column to "tbTotLabor" so there won't be any confusion (damned Access for
naming them that way....) Still, whether I use 'Sum(tbTotLabor)' or
'Sum(TotLabor)', I get a #Error consistently. (A2007)

Ideas?
 
J

JimS

My mistake. That is the syntax I'm using. =Sum(TotLabor). I actually built it
with the wizard so I wouldn't spell something wrong or something equally
stupid.
 
R

Roger Carlson

It should work. Are you certain that the column is calculating correctly in
EVERY row? If there is an #Error in even one of the values, you'll get
#Error in the sum. This could happen for a variety of odd circumstances.
For instance, if your calculation results in a division by zero, or if one
of your values happens to be a text value rather than numeric.
 
J

JimS

Now, here's a kicker. I put a new text box on the form footer to experiment.
If I use dsum() instead of sum(), it works:

=DSum("TotLabor","qryBoMDetailbyWO",[Filter])

Is that even close to sensible?
 
J

JimS

OK, now, I'm flumoxed. Suddenly, everything works flawlessly. Both the =Sum()
syntax and the =dSum() syntax suddenly start working. WTF? I didn't even
close the form!
 

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