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  

#Error when summing in Form



 
 
Thread Tools Display Modes
  #1  
Old January 21st, 2010, 09:29 PM posted to microsoft.public.access.forms
iamnu
external usenet poster
 
Posts: 99
Default #Error when summing in Form

I add a NEW control to the Footer of a Subform with a Control Source
as follows: =([AmtBilled]). This will give me a value from a record
of the Detail section of the same Subform.

If I change the Control Source to =Sum([AmtBilled]), I get #Error.

All of my controls that contain the Sum function are NOW giving me
this #Error. I made this to happen with some change I have made, but
I can't figure out what I have done to cause this.

Can someone point me in the direction to solving this problem?

Thanks...
  #2  
Old January 21st, 2010, 10:32 PM posted to microsoft.public.access.forms
Dorian
external usenet poster
 
Posts: 542
Default #Error when summing in Form

You need to sum by control name not by column name.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".


"iamnu" wrote:

I add a NEW control to the Footer of a Subform with a Control Source
as follows: =([AmtBilled]). This will give me a value from a record
of the Detail section of the same Subform.

If I change the Control Source to =Sum([AmtBilled]), I get #Error.

All of my controls that contain the Sum function are NOW giving me
this #Error. I made this to happen with some change I have made, but
I can't figure out what I have done to cause this.

Can someone point me in the direction to solving this problem?

Thanks...
.

  #3  
Old January 21st, 2010, 11:06 PM posted to microsoft.public.access.forms
Linq Adams via AccessMonster.com
external usenet poster
 
Posts: 1,474
Default #Error when summing in Form

Is [AmtBilled] a calculated field? You cannot run an aggregate function like
SUM against a calculated field. You have to use the expression used for the
calculation.

For instance, if

[AmtBilled] = [Units] * [UnitCost]

instead of

Sum([[AmtBilled])

you'd use

Sum([Units] * [UnitCost])

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via http://www.accessmonster.com

 




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 11:06 AM.


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