473,326 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Calculations in reports

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
3 2236
"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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: lduperval | last post by:
Hi, I`m trying to do date calculations in three types of time zones: local, GMT and specified. The issue I am facing is that I need to be able to specify a date in the proper time zone, and I`m...
2
by: Willem | last post by:
Hi there, I'm sort of new with doing much record manipulation with queries. Up till now I've been programming VBA and doing record looping to get my results. This works fine but tends to get...
2
by: Mark Lees | last post by:
I need some help setting up some date caluclations. Fields Include: A. DOB "date of birth" B. IFSPOrginal "Date IFSP is entered" C. IFSPRedo "Date 12 months into the future from...
1
by: Dan Kean | last post by:
Hi all, I need to calculate some amounts on reports from rcords before they print, struggling doing so as it doesnt seem to run the calcs asks for parameters instead- do I need to do it as a form...
6
by: migueltxa | last post by:
Hi all, I have a problem with some calculations in MS Access 2003. I have 3 fields (Qty, Price and VolumeUSD) in a form and the following formula: VolumeUSD = Qty * Price. Qty and VolumeUSD...
0
by: md100 | last post by:
I have calculations in a report to work out payments deducting tax for some unless tax deduction flag is given using the statement =IIf(=True,(),(-((/100)*22))) This value is being stored in...
1
by: Grubsy4u | last post by:
Grubsy4u Newbie 7 Posts October 5th, 2007 11:31 AM #1 Report calculations --------------------------------------------------------------------------------
4
by: Grubsy4u | last post by:
Does anyone know how i can do calculations for search query reports. How is this overcome because the search will be differrent with a different report every time. Is there a formular i can use...
9
Catalyst159
by: Catalyst159 | last post by:
I have a form which is used to calculate residential Floor Area Ratio (FAR). The form is structured into seven parts as follows: Part A: Maximum FAR and Floor Area: Part B: Gross Floor Area of...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.