By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,997 Members | 2,841 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,997 IT Pros & Developers. It's quick & easy.

Calculations in reports

P: n/a
Hi,

I've been coming up against a failure of a report to display the result of a
simple calculation. I have realised that this calculation cannot take place
unless the field I am working on is displayed or is some way referred to in
the report. am I right in this? It seems odd if the field is there in the
underlying query.

Is this right? Is there a way round?
Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"Calculations" -- could you clarify? Are the calculations in event code, or
an expression in the Control Source of a Control? Control Source expressions
can refer to a field in the Report's RecordSource. For example, you can use
the Sum or Count functions in the Control Source of a Control to total or
count in the Group or Report Footer -- it's very common.

Performing calculations in Report event code can be problematic because the
events may fire more than once for a record, even just going forward. They
may fire quite a number of times in Report Preview, as you scroll forward
and backward. That is why calculations must be very, very carefully done, or
avoided in the Format and Print events.

Larry Linson
Microsoft Access MVP
Larry Linson
Microsoft Access MVP

"John M" <jo**@jmawer.demon.co.uk> wrote in message
news:ck*******************@news.demon.co.uk...
Hi,

I've been coming up against a failure of a report to display the result of a simple calculation. I have realised that this calculation cannot take place unless the field I am working on is displayed or is some way referred to in the report. am I right in this? It seems odd if the field is there in the underlying query.

Is this right? Is there a way round?

Nov 13 '05 #2

P: n/a
John M wrote:
Hi,

I've been coming up against a failure of a report to display the result of a
simple calculation. I have realised that this calculation cannot take place
unless the field I am working on is displayed or is some way referred to in
the report. am I right in this? It seems odd if the field is there in the
underlying query.

Is this right? Is there a way round?


Let's say your query has a field called Price. If you don't drop Price
onto the report, and attempt to reference it in a calc, you'll get an error.

So you can drop Price onto the report and make the Visible property = No.

Let's say you create a text box that is to display 10% of the price.
You would enter
=[Price] * .1

Nov 13 '05 #3

P: n/a
With the exception of column totals I normally do my calcs in the query.

It keeps the report simple.

gus

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.