A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Sum error on continous subform



 
 
Thread Tools Display Modes
  #1  
Old June 3rd, 2010, 08:01 PM posted to microsoft.public.access.forms
Jeff via AccessMonster.com
external usenet poster
 
Posts: 6
Default 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  
Old June 3rd, 2010, 08:57 PM posted to microsoft.public.access.forms
Golfinray
external usenet poster
 
Posts: 1,597
Default 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  
Old June 3rd, 2010, 09:22 PM posted to microsoft.public.access.forms
Jeff via AccessMonster.com
external usenet poster
 
Posts: 6
Default 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  
Old June 3rd, 2010, 09:40 PM posted to microsoft.public.access.forms
Jeff via AccessMonster.com
external usenet poster
 
Posts: 6
Default 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  
Old June 4th, 2010, 12:02 AM posted to microsoft.public.access.forms
Linq Adams via AccessMonster.com
external usenet poster
 
Posts: 1,474
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:29 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.