Total Function in a Form

  • Thread starter Thread starter John David
  • Start date Start date
J

John David

I know I should have used a Query of some sort, but I
didn't realize I would have this problem.

I have a form with a subform and within the subform I have
data input lines. It's very straightforward in that each
line has Units and Cost that are multiplied together to
provide a total on each line, which works.

Then, in order to see the total on the Form, I have to add
up the sum of the totals in the Form Footer using =Sum
([Total])(although I don't know if this works, since it
doesn't show up on the form itself). Then I have to
reference that same box on the main form using a formula
(kind of involved, but basically "in the form, in the
subform, this box", which I'm sure I have right according
to the book I'm using (Access 2002 Bible) but it comes up
either blank or with an "Err" message.

Can anyone help me? Thanks.
 
John-

You can run into some timing issues when you try to fetch a calculated sum
from a subform. Sometimes, it's best to replicate the calculation using a
call to the DSum function.

--
John Viescas, author
"Microsoft Office Access 2003 Inside Out" (coming soon)
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
http://www.viescas.com/
(Microsoft Access MVP since 1993)
 
-----Original Message-----
John-

You can run into some timing issues when you try to fetch a calculated sum
from a subform. Sometimes, it's best to replicate the calculation using a
call to the DSum function.

--
John Viescas, author
"Microsoft Office Access 2003 Inside Out" (coming soon)
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
http://www.viescas.com/
(Microsoft Access MVP since 1993)
John David said:
I know I should have used a Query of some sort, but I
didn't realize I would have this problem.

I have a form with a subform and within the subform I have
data input lines. It's very straightforward in that each
line has Units and Cost that are multiplied together to
provide a total on each line, which works.

Then, in order to see the total on the Form, I have to add
up the sum of the totals in the Form Footer using =Sum
([Total])(although I don't know if this works, since it
doesn't show up on the form itself). Then I have to
reference that same box on the main form using a formula
(kind of involved, but basically "in the form, in the
subform, this box", which I'm sure I have right according
to the book I'm using (Access 2002 Bible) but it comes up
either blank or with an "Err" message.

Can anyone help me? Thanks.


.
Wish this had been on here a couple of days ago. I spent
several hours trying to get something like this to work
and discovered it was a timing problem and used a query.
 
Back
Top