If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Sum error on continous subform
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 -- Message posted via http://www.accessmonster.com |
#2
|
|||
|
|||
Sum error on continous subform
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]) -- Milton Purdy ACCESS State of Arkansas "Jeff via AccessMonster.com" wrote: 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 -- Message posted via http://www.accessmonster.com . |
#3
|
|||
|
|||
Sum error on continous subform
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 golfinray wrote: 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] -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/201006/1 |
#4
|
|||
|
|||
Sum error on continous subform
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 Jeff wrote: 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] -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/201006/1 |
#5
|
|||
|
|||
Sum error on continous subform
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) -- There's ALWAYS more than one way to skin a cat! Answers/posts based on Access 2000/2003 Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/201006/1 |
Thread Tools | |
Display Modes | |
|
|