Calculated control based off other calculated controls (1 Viewer)

tmyers

Active member
Local time
Today, 13:51
Joined
Sep 8, 2020
Messages
717
I am trying to make a running summary form/subform that will just have controls displaying running totals/average/percentages etc. The first one is giving me some problems however in that all I can get it to display is #Error.

For the control source, within the expression builder I am going down the chain of references to the exact forms and controls I am trying to summarize. Here is what the expression builder cobbles together;
=Sum([ProjectTotalsQrySub].[Form]![ExtensionTxtBx])
That however throws the #Error. The referenced text box has the calculation =[SumOfQty]*[Unit Price]. To go even further, [Unit Price] is a calculation being done within the source query of the sub-form.

Can I not do this the "simple" way via expressions in controls?
 

tmyers

Active member
Local time
Today, 13:51
Joined
Sep 8, 2020
Messages
717
I would like to add that I am just doing it via a query now, but I am curious as to why doing it via controls does not work.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 10:51
Joined
Oct 29, 2018
Messages
17,122
Can I not do this the "simple" way via expressions in controls?
You should be able to, but

For the control source, within the expression builder I am going down the chain of references to the exact forms and controls I am trying to summarize.
If the values you're trying to sum are in another Form, I am not sure you can do that.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 13:51
Joined
May 21, 2018
Messages
5,686
If I understand what you want to do. In the subform footer add something like (can be hidden)
=sum([SumOfQty]*[Unit Price])
On the main form you should be able to directly reference that hidden field
=[projectTotalsQrySub].[Form]![txtBoxTotalSum]
 

Users who are viewing this thread

Top Bottom