Sum error on continous subform

  • Thread starter Jeff via AccessMonster.com
  • Start date
J

Jeff via AccessMonster.com

I have been pulling my hair on this one.
I will try to use the proper terminology to describe my problem...
On the header of a continuous subform I would like to calculate the sum of a
field on my subform.
On the subform, the control name that is to be summed is TicketWeight1. Its
field name (control source) is TicketWeight
In the header of the continuous subform, I have a control named
Ticketweighttotal which control source is =Sum([TicketWeight])
This returns Error in the control
The TicketWeight field name is a field in the underlying table and not the
result of a calculation.

Jeff Sauzeat
 
G

golfinray

In my opinion, the easiest way is to put a hidden textbox in the footer of
the subform. Set its controlsource to =sum([ticketweight])
Then put a textbox on the mainform and set its controlsource to
=([name of the subform control].form![nameofthetextboxinsubform])
 
J

Jeff via AccessMonster.com

Thanks for the reply.
The problem is that =Sum([TicketWeight]) in the footer (or header) returns an
error to begin with...
This should be a very simple issue but I cannot figure out why this simple
formula is failing.
When I remove the agregate function sum and set the control source to =
[TicketWeight] it returns the value of the first line of TicketWeight1 in the
subform...

Jeff
In my opinion, the easiest way is to put a hidden textbox in the footer of
the subform. Set its controlsource to =sum([ticketweight])
Then put a textbox on the mainform and set its controlsource to
=([name of the subform control].form![nameofthetextboxinsubform])
I have been pulling my hair on this one.
I will try to use the proper terminology to describe my problem...
[quoted text clipped - 9 lines]
 
J

Jeff via AccessMonster.com

I tried to substitute the Sum function with Avg function (=Avg([TicketWeight]
)) and the avg function works. This problem seems to be isolated to the sum
function
Thanks for the reply.
The problem is that =Sum([TicketWeight]) in the footer (or header) returns an
error to begin with...
This should be a very simple issue but I cannot figure out why this simple
formula is failing.
When I remove the agregate function sum and set the control source to =
[TicketWeight] it returns the value of the first line of TicketWeight1 in the
subform...

Jeff
In my opinion, the easiest way is to put a hidden textbox in the footer of
the subform. Set its controlsource to =sum([ticketweight])
[quoted text clipped - 3 lines]
I will try to use the proper terminology to describe my problem...
[quoted text clipped - 9 lines]
 
L

Linq Adams via AccessMonster.com

Is [TicketWeight] an entered field or a calculated field? Aggregate Functions
don't work against calculated fields, you have to run them againgst the
expression used for the calculation.

If A + B = C, you can't use

Sum([C])

you have to use

Sum(A + B)
 

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