Referencing textbox controls

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?
 
A

Allen Browne

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]...
 
K

KHogwood-Thompson

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?
 
A

Allen Browne

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.
 
K

KHogwood-Thompson

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top