Hi all
I am using Access2000 and I am creating a report based on a query.
Query1=" select Id,name,Amount from Eployees"
This query returns many records, so in the report this result must be shown as if continuous. I did that by inserting a report header and footer. But the preblem is that I want the the summation of a particular field 'Amount'. So what I did is creating a text box in the report footer and in it's Data/Row Source I wrote " =Sum([text1])" and it went ok.
The problem rose when the field (text1) is not bounded directly to the query, when in it's row source is writen some code.like:' =iif(amount<1000,name,"") '.
The results in text1 are just what I need but In that text box in the report footer nothing happens.
What am I missing?
7 2301 MMcCarthy 14,534
Recognized Expert Moderator MVP
Hi all
I am using Access2000 and I am creating a report based on a query.
Query1=" select Id,name,Amount from Eployees"
This query returns many records, so in the report this result must be shown as if continuous. I did that by inserting a report header and footer. But the preblem is that I want the the summation of a particular field 'Amount'. So what I did is creating a text box in the report footer and in it's Data/Row Source I wrote " =Sum([text1])" and it went ok.
The problem rose when the field (text1) is not bounded directly to the query, when in it's row source is writen some code.like:' =iif(amount<1000,name,"") '.
The results in text1 are just what I need but In that text box in the report footer nothing happens.
What am I missing?
You can't sum a calcuated field by textbox name. Try something like this ... - =Sum(IIf(amount<1000,amount,0))
You can't sum a calcuated field by textbox name. Try something like this ... - =Sum(IIf(amount<1000,amount,0))
Maybe I didn't axplain well. In the detail section I have a text 'Text1' that calculates a value. It's row source looks like: =IIf(amount<1000,amount,0)
The 'amount' is a field from the query.
Outside of the Details section, In the report footer I have an other TextBox 'Text2' having in it's row source: = Sum(Text1)
The summation is not working when in Text1 the data is calculated otherwise when Text1 is directly bounded to the query and having 'amount' as row source everything goes right.
MMcCarthy 14,534
Recognized Expert Moderator MVP
Maybe I didn't axplain well. In the detail section I have a text 'Text1' that calculates a value. It's row source looks like: =IIf(amount<1000,amount,0)
The 'amount' is a field from the query.
Outside of the Details section, In the report footer I have an other TextBox 'Text2' having in it's row source: = Sum(Text1)
The summation is not working when in Text1 the data is calculated otherwise when Text1 is directly bounded to the query and having 'amount' as row source everything goes right.
Did you try putting what I gave you in Text2?
Did you try putting what I gave you in Text2?
Thanks Mary for the support
I tried what you said and it worked very well. But I want to ask: how did that happened? If you can explain. Knowing that Text2 is running once so I expect to calculate the last Record only.
MMcCarthy 14,534
Recognized Expert Moderator MVP
Thanks Mary for the support
I tried what you said and it worked very well. But I want to ask: how did that happened? If you can explain. Knowing that Text2 is running once so I expect to calculate the last Record only.
Don't understand what you mean by the last sentence.
The reason it works is that ...
You can't sum() on Text1 because it is a calculated field and you can't aggregate (sum, count, etc.) on calculated fields. However, you can sum() on the calculation itself.
Don't understand what you mean by the last sentence.
The reason it works is that ...
You can't sum() on Text1 because it is a calculated field and you can't aggregate (sum, count, etc.) on calculated fields. However, you can sum() on the calculation itself.
Thanks for the explanation
What I ment is that Text2 is filled once at the openning of the report, true?
so how can he caculate the result of a query that returns many records?
MMcCarthy 14,534
Recognized Expert Moderator MVP
Thanks for the explanation
What I ment is that Text2 is filled once at the openning of the report, true?
so how can he caculate the result of a query that returns many records?
Text2 is in the report footer so is calculated after the fill of all details
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: CSDunn |
last post by:
Hello,
I have a situation with MS Access 2000 in which I need to display report
data in spreadsheet orientation (much like a datasheet view for a form). If
you think of the report in terms of what...
|
by: Nathan Bloomfield |
last post by:
Does anyone know if there is any documentation which relates to Access2k + ?
or can anyone help adjust the code?
I am having trouble converting the DAO references.
TITLE :INF: How to...
|
by: Bob Alston |
last post by:
I am looking for Access reporting add-in that would be easy to use by
end users. My key focus is on selection criteria. I am very happy with
the Access report writer capabilities. As far as...
|
by: lorirobn |
last post by:
Hi,
I have a report that works just fine.
Now I would like to add the capability to choose selection criteria to
limit what is displayed. I created several reports that do this, but
they used...
|
by: crazydrummer |
last post by:
hi everyone, fairly new to access and VBA, but have fundamental knowledge.
as part of a college project i am building a database that records "downtime" for machines in a company.
the...
| |
by: logieen |
last post by:
Hi , Every one I have a problem to solve this summation in c++ ;
1/3 + 3/5 +5/7 .......
this the program I wrote
#include <stdio.h>
#include <iostream.h>
#include <conio.h>
#include...
|
by: Darsin |
last post by:
Hi all
I need to perform a summation on a column of a table based on a
criteria given in another column in the same table. The catch is i
need to perform different sums according to the number of...
|
by: =?ISO-8859-1?Q?Szabolcs_Horv=E1t?= |
last post by:
I did the following calculation: Generated a list of a million random
numbers between 0 and 1, constructed a new list by subtracting the mean
value from each number, and then calculated the mean...
|
by: galaxianape |
last post by:
Please help me with summation in C lang.
I m trying to divide the summation of alpha * delta with summation of alpha
this is half the program that i have written...but it gives error. pls help.....
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |