Referencing textbox controls

  • Thread starter Thread starter KHogwood-Thompson
  • Start date Start date
K

KHogwood-Thompson

I have a report that contains sorting and grouping. In the detail section I
have two textbox controls called "NETPROFMONTH" and "NETPROFYTD". In one of
the group footers I am trying to sum the totals of the two textboxes above.
However when I type the following into the footer textbox controls:

=Sum([NETPROFMONTH])

And

=Sum([NETPROFYTD])

and then run the report, I get the parameter box asking for the values of
the two controls. Can anyone advise?
 
I take it that NETPROFMONTH is the a text box that contains an expression,
i.e. it is not a field in the report's source query?

If so, try repeating the expression in the footer text box. For example, if
its ControlSource is:
=[x] - [y]
then use:
=Sum([x] - [y])

The aggregation can occur only on the value of fields, not on controls.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

message
news:[email protected]...
 
Okay I can undertand that, the NETPROFMONTH expression contains an Iff
statement:

=IIf([CATEGORY 1]="Turnover",[SumOfMONTH]*-1,[SumOfMONTH]*1)

If I copy this as suggested and use it as a SUM, will the formatting of the
sign (*-1 etc) be retained??
--
K Hogwood-Thompson


Allen Browne said:
I take it that NETPROFMONTH is the a text box that contains an expression,
i.e. it is not a field in the report's source query?

If so, try repeating the expression in the footer text box. For example, if
its ControlSource is:
=[x] - [y]
then use:
=Sum([x] - [y])

The aggregation can occur only on the value of fields, not on controls.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

message
I have a report that contains sorting and grouping. In the detail section I
have two textbox controls called "NETPROFMONTH" and "NETPROFYTD". In one
of
the group footers I am trying to sum the totals of the two textboxes
above.
However when I type the following into the footer textbox controls:

=Sum([NETPROFMONTH])

And

=Sum([NETPROFYTD])

and then run the report, I get the parameter box asking for the values of
the two controls. Can anyone advise?
 
message
Okay I can undertand that, the NETPROFMONTH expression contains an Iff
statement:

=IIf([CATEGORY 1]="Turnover",[SumOfMONTH]*-1,[SumOfMONTH]*1)

If I copy this as suggested and use it as a SUM, will the formatting of
the
sign (*-1 etc) be retained??

Try it and see.
 
works perfectly, thanks very much!
--
K Hogwood-Thompson


Allen Browne said:
message
Okay I can undertand that, the NETPROFMONTH expression contains an Iff
statement:

=IIf([CATEGORY 1]="Turnover",[SumOfMONTH]*-1,[SumOfMONTH]*1)

If I copy this as suggested and use it as a SUM, will the formatting of
the
sign (*-1 etc) be retained??

Try it and see.
 
Back
Top