473,473 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to access individual fields in a report to produce a grand total.

Dear Access Developers:

I have an interesting problem that I hope someone could suggest how to
solve:

I have the following Report:

Col-1 Col-2
-------- -------
483.3 100
57.1 65
686.0 109
860.1 139
--------
2086.5

I need to show on the report a "special total" using the following
formula:

special total = 100 X (483.3/2086.5) + 65 X (57.1/2086.5) +
109 X (686.0/2086.5) + 139 X (860.1/2086.5)

If you notice, the formula requires access to individual values. How do
I refer to individual records/fields in a report??

I've been able to reproduce the formula using SQL in the query design
grid then pasting the SQL code into the Control Source of a text box
positioned in the report. I get a syntax error telling me that there are
too many ")", but the SQL code works perfectly when executed from the
Query Design grid. Here is the SQL code:

SELECT Sum([EFF]*([MIN]/(SELECT Sum([MIN]) FROM
test_700_Efficiency_qry;))) AS MyTot
FROM test_700_Efficiency_qry;
So my question is how do I retrieve individual values from a report or
is there a better approach to this problem instead of using SQL?

Thank you for any help!
Greg
*** Sent via Developersdex http://www.developersdex.com ***
Apr 13 '06 #1
2 1721
> I have the following Report:

Col-1 Col-2
-------- -------
483.3 100
57.1 65
686.0 109
860.1 139
--------
2086.5
I need to show on the report a "special total" using the following
formula:

special total = 100 X (483.3/2086.5) + 65 X (57.1/2086.5) +
109 X (686.0/2086.5) + 139 X (860.1/2086.5)
If you notice, the formula requires access to individual values. How
do I refer to individual records/fields in a report??

So my question is how do I retrieve individual values from a report or
is there a better approach to this problem instead of using SQL?


I suggest you to avoid complexing your life with so complex calculated field,
and to use VBA to get all the values you want.
You may open a recordset in the page header format event, use it in the page
body format event to get all values you need, and finally to use those values
in the page footer format event to populate relative unbound fields.

--
PBsoft di Gabriele Bertolucci
www.pbsoft.it
skype: pbsoftsolution
Apr 13 '06 #2

Thank you Gabriel for your suggestions. I'll look into doing that. I
welcome any further comments from anyone else on this issue.
Thanks...Greg
*** Sent via Developersdex http://www.developersdex.com ***
Apr 16 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: MushMouse | last post by:
I have a report in which I have 2 subreports, each with a subtotal in the report footer. I'd like to add the 2 subtotals together in the main report. If one of the subreports doesn't have data for...
3
by: CSDunn | last post by:
Hello, I have 14 fields on a report that hold integer values. The field names use the following naming convention: T1Number, T2Number ....T14Number. I need to get a 'sub total' of all fields as...
4
by: alexandre.brisebois | last post by:
Hi, I am using access 2003, I would like to know if there is an option to reorganize the tables in a maner that is readable, as we can do in sql sever 2000 or 2005. I have been given a database...
1
by: Chrissie40park | last post by:
Hi I am having problems designing a Report in Access 2000. My master table is based on Job numbers, profiling Projects on which a number of staff are working. For resourcing reasons we need to...
4
by: Seyi1 | last post by:
I am attempting to create a report with sub-totals in the body of the report and a total at the bottom. how do I go about doing this thanks: here is an example of the result I need to achive ...
1
by: aman909 | last post by:
Hello, I have a stock control database system. Im trying to produce a report of the stock levels we have. At the end of the report i would like to be able to give a final total of stock. By...
7
by: Bobh | last post by:
I am trying to figure out some code for a report issue; I have an employee who has a incentive scheme. I have a report showing various income amounts and in the report footer I vae totals for...
2
by: peter1234 | last post by:
I am trying to produce study notes for ACCESS, and for many days I am stuck trying to produce totals and subtotals for table ‘Order Details’ from ‘Northwind Sample Access Database’. The fact that I...
6
by: shalskedar | last post by:
In the Report 1 of the fields contain expression.When i m trying to find the grandtotal for this field it gives me error.. For ex- The field expression is Format(,"0.00") to limit the field value...
0
marktang
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...
0
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...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.