Can't see calculated control

  • Thread starter TonyWilliams via AccessMonster.com
  • Start date
T

TonyWilliams via AccessMonster.com

I have a calculated control on a report called txttotalID with a record
source which is
=YTDValue("txtMonth","CountofID","qrypurpose",[txtmonth])
The YTDValue refers to a Module taht calculates YTD figures The rpeorts
record source is qrypurpose and the query has the fileds txtmonth and
CountofID and that works fine and gives me a value..

I have another calculated control called TotalID where the record source is
=Sum([txttotalID]), the txttotalID being my first calculated control. However,
when I run the report I get a prompt asking for the value of txttotalID. Does
this mean that one calculated control can't reference another calculated
control on the same report?
Tony
 
J

John Spencer

Yes and No.

A calculated control can refer to another control. HOWEVER, the aggregate
functions (Sum, Count, etc. can only refer to fields in the report's source.

So you need to figure out a way to calculate the YTD value in the query that
is the source for the report or try the following (which may or may not work):
Sum(YTDValue("txtMonth","CountofID","qrypurpose",[txtmonth]))

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
 
T

TonyWilliams via AccessMonster.com

Thanks John I put the YTD expression in the query and got the result. Thanks
for the info.
Cheers
Tony

John said:
Yes and No.

A calculated control can refer to another control. HOWEVER, the aggregate
functions (Sum, Count, etc. can only refer to fields in the report's source.

So you need to figure out a way to calculate the YTD value in the query that
is the source for the report or try the following (which may or may not work):
Sum(YTDValue("txtMonth","CountofID","qrypurpose",[txtmonth]))

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
I have a calculated control on a report called txttotalID with a record
source which is
[quoted text clipped - 9 lines]
control on the same report?
Tony
 

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