From: briank on
I would like to created a simple calculation in my footer's text box but I
suspect that I'm missing an obvious roadblock somewhere. First of all, the
Build button in the Control Source is greyed out so I typed the calc in
manually <the calculation is =sum((val([textbox1]) + val([textbox2])) >.
When I run the report from a VBA induced Run button, the report never shows
up (keep in mind that this only happens when I add this calc field).
Probably important to note that the source query is a stored procedure.
Barring looking through endless lines of code behind the Run button, is there
an obvious solution here? TY.
From: Marshall Barton on
briank wrote:

>I would like to created a simple calculation in my footer's text box but I
>suspect that I'm missing an obvious roadblock somewhere. First of all, the
>Build button in the Control Source is greyed out so I typed the calc in
>manually <the calculation is =sum((val([textbox1]) + val([textbox2])) >.
>When I run the report from a VBA induced Run button, the report never shows
>up (keep in mind that this only happens when I add this calc field).
>Probably important to note that the source query is a stored procedure.
>Barring looking through endless lines of code behind the Run button, is there
>an obvious solution here?


You can only use an aggregate function on record source
fields. These functions are totally unaware of controls on
a form or report.

If you can figure out where textbox 1 and 2 get their
values, then you can use those fields or expressions in the
Sum function. E.g. If you have a text box named Amount
that has an expression like =Quantity * Price, you can NOT
use =Sum(Amount) Instead you need to use:
=Sum(Quantity * Price

--
Marsh
MVP [MS Access]