473,508 Members | 2,007 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can't get sum in subform footer to work.

wordbrew
29 New Member
Hello all,

I searched the forums as much as I can and haven't found a viable solution.

I have a subform that filters the records by Publisher.

In the subform I have a calculated control called "% of Track Commission", that takes the subform control "# of Writers" and divides it by the subform control "# of Writers for Track".

From this I have another control called "TotalTrackCommission" that then takes "% of Track commission" and multiplies it with "Commission Per Track."

All of this works fine.

The problem arises when I try to put a text box control in the subform footer to sum the "TotalTrackCommission" text box control for the current records shown.

Currently I'm trying to use =Sum([TotalTrackCommission]), but this only returns #Error. If I use =([TotalTrackCommission]) it does return a value, but obviously only for one of the values, not the sum of them. I know my problem probably lies in the fact that I'm trying to sum a calculated control (which is calculated off another calculated control LOL), but I just don't know the avenues I should be trying to take.

So I would appreciate any insight, whether I'm just referencing it wrong, or if I should somehow utilize a query, etc... My ultimate goal of course is to have a text box control on the main form pull the sum from this footer control.

Thanks for you time!

As a side note, is there a way to have another text box control "CommissionPerTrack" in the subform, take it's value from a control in the main form, or from a table unrelated to the one used by the subform? I tried adding the other table to the subforms record source so I could utilize it, but even though that works, it locks the controls for publisher where I can't change anything in the control boxes anymore. Right now I just set the control to a value of .091, but I would rather it pull this from the main form (or table) as this value is subject to change, and I won't be the one ultimately using the database, so this value needs to be changed easily. The form I'm trying to pull from is frmAlbumCommission, and the control is "Commission Per Track", or the table possibility is tblAlbumCommissions, and the field is "CommissionPerTrack". I know the names could be differentiated better, but it is what it is you know.

Again I appreciate any help.
Feb 4 '10 #1
3 4883
nico5038
3,080 Recognized Expert Specialist
You can't use "calculated controls" to sum, use instead the sum of the calculation like:
Expand|Select|Wrap|Line Numbers
  1. =sum([# of Writers"] / [# of Writers for Track])
  2.  
I would also recommend to use no special characters and/or spaces in your field names.
Use e.g. [NumOfWriters], [NumOfWritersForTrack], etc.

Nic;o)
Feb 6 '10 #2
wordbrew
29 New Member
Hey Nico, I really appreciate your response to my problem. And I agree with you that I should lose the special characters and spaces. I'm proficient in access and i'm slowly losing the bad habits lol.

I had actually tried using that solution before I posted but for some reason I still couldn't get it to work (lol could be user error?).

But that did ultimately solve my problem. I really appreciate it. I then ended up using another calculated control in the footer that multiplied this result by another text box in the main form to get another sum result that I couldn't reference directly (another calculated field in the subform), but was able to work around that problem using this route.

Here's hoping there's always a work around to any problem we encounter.

Thanks again!
Feb 7 '10 #3
nico5038
3,080 Recognized Expert Specialist
I sometimes add the calculation to the query and use it in the footer's SUM().

Nic;o)
Feb 7 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
5533
by: Lyn | last post by:
Hi, I have a form which contains a number of subforms in different pages of a tab control. In the detail section of each subform, I list records related to the main form record, but from...
1
4417
by: phaddock4 | last post by:
Being fairly inexperienced at Access 2000, i've been reading many posts here for the last several days, and testing myself to find the best approach to do the following in A2K: SET UP: I have...
2
1971
by: Bruce | last post by:
Hi, I have 3 nested forms and wish to calculate a value on Subform 1 by adding 2 values on the same subform + to a value in a control on the footer of the underlying subform . I use this as the...
11
2484
by: musicloverlch | last post by:
I have a form with a subform that has a subform that has a subform that has a subform. The 5th embedded subform never opens in Access 97 and I get a message that 'a form has caused 1 error.' When I...
30
8856
by: Shannan Casteel via AccessMonster.com | last post by:
I have a subform named "sbfrmParts" with a list of parts along with the quantity and price. I have used a text box in the subform's footer and set the control source to "=Sum(*)". I set the...
2
1923
by: Anthony England | last post by:
I wonder if anyone would have 5 minutes to check this for me. Access XP with new database created: Simple table tblTest: ID=autonumber, F1=Text with a few sample records frmSub has this as its...
3
3627
by: Kitana907 | last post by:
Hi- I am having issues with adding up fields in a subform. I have a form that has a subform in datasheet mode. It lists titles of books with their correlating units and dollar amount . The...
2
6489
by: post | last post by:
Sorry that this is rather basic. But I have tried the various suggestions given in this group and cannot get them to work. I have a main form, for simplicity called "Main". On it are two...
7
9278
AccessIdiot
by: AccessIdiot | last post by:
This is driving me nuts. I have an unbound textbox (txt_SumSize) in my subform that holds the total of a field (Debitage_Size_Quantity)seen in datasheet view (control source =Sum(). I have an...
2
4099
by: csolomon | last post by:
Hello: I would like to use information on one form to populate another form. There are 2 controls I would like to transfer; a list box control and a text box control. both are unbound controls...
0
7226
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7388
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7049
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7499
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5631
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4709
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3199
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3186
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
767
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.