Prev: Need from to replicate itself as a blank for each time it is opene
Next: status validation help
From: Jeff via AccessMonster.com on 3 Jun 2010 15:01 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
From: golfinray on 3 Jun 2010 15:57 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 > > . >
From: Jeff via AccessMonster.com on 3 Jun 2010 16:22 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/Forums.aspx/access-forms/201006/1
From: Jeff via AccessMonster.com on 3 Jun 2010 16:40 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/Forums.aspx/access-forms/201006/1
From: Linq Adams via AccessMonster.com on 3 Jun 2010 19:02 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/Forums.aspx/access-forms/201006/1
|
Pages: 1 Prev: Need from to replicate itself as a blank for each time it is opene Next: status validation help |