473,396 Members | 1,917 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,396 software developers and data experts.

Access report totals

Hello-

I just managed to get the total from my subreport to sum with my main
report total. I am able to get the correct display if I do not have any
total in my subreport. BUT, what if I don't have a total in my main
report? Below is the control source for my main report's total textbox.

=Sum([ExtPrice])+IIf(srptSOPItems.Report.HasData,srptSOPItems.Rep ort.SOPTotal,0)

Again, if there is only a total from the sub, and not the main report,
how would you rewrite this equation to reflect that?

Thanks-

Scott

Nov 13 '05 #1
6 3452
Use Nz() to specify zero for null:

=Nz(Sum([ExtPrice]),0) +
IIf(srptSOPItems.Report.HasData,Nz(srptSOPItems.Re port.SOPTotal,0),0)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Scott" <ss***@henryschein.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...

I just managed to get the total from my subreport to sum with my main
report total. I am able to get the correct display if I do not have any
total in my subreport. BUT, what if I don't have a total in my main
report? Below is the control source for my main report's total textbox.

=Sum([ExtPrice])+IIf(srptSOPItems.Report.HasData,srptSOPItems.Rep ort.SOPTotal,0)

Again, if there is only a total from the sub, and not the main report,
how would you rewrite this equation to reflect that?

Nov 13 '05 #2

Allen Browne wrote:
Use Nz() to specify zero for null:

=Nz(Sum([ExtPrice]),0) +
IIf(srptSOPItems.Report.HasData,Nz(srptSOPItems.Re port.SOPTotal,0),0)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Scott" <ss***@henryschein.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...

I just managed to get the total from my subreport to sum with my main report total. I am able to get the correct display if I do not have any total in my subreport. BUT, what if I don't have a total in my main
report? Below is the control source for my main report's total textbox.
=Sum([ExtPrice])+IIf(srptSOPItems.Report.HasData,srptSOPItems.Rep ort.SOPTotal,0)
Again, if there is only a total from the sub, and not the main report, how would you rewrite this equation to reflect that?


This just returned #ERROR......Any ideas?

Nov 13 '05 #3
If there are no records in the main report, you will need to test its
HasData property as well.

If there are records, split the expression into 2 text boxes until you get
it working correctly. Once you have it solved, you can put it back together
again.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Scott" <ss***@henryschein.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...

Allen Browne wrote:
Use Nz() to specify zero for null:

=Nz(Sum([ExtPrice]),0) +
IIf(srptSOPItems.Report.HasData,Nz(srptSOPItems.Re port.SOPTotal,0),0)
"Scott" <ss***@henryschein.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
>
> I just managed to get the total from my subreport to sum with my main > report total. I am able to get the correct display if I do not have any > total in my subreport. BUT, what if I don't have a total in my main
> report? Below is the control source for my main report's total textbox. >
> =Sum([ExtPrice])+IIf(srptSOPItems.Report.HasData,srptSOPItems.Rep ort.SOPTotal,0) >
> Again, if there is only a total from the sub, and not the main report, > how would you rewrite this equation to reflect that?


This just returned #ERROR......Any ideas?

Nov 13 '05 #4

Allen-

Thanks for the help on this. It would be when the main report has no
records, but the sub report does. How would you test the HasData
property?
*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #5

=IIf([Report].[HasData], Nz(Sum([ExtPrice]),0), 0) +
IIf(srptSOPItems.Report.HasData,Nz(srptSOPItems.Re port.SOPTotal,0),0)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Scott Sabo" <ss***@henryschein.com> wrote in message
news:bV**************@news.uswest.net...

Allen-

Thanks for the help on this. It would be when the main report has no
records, but the sub report does. How would you test the HasData
property?

Nov 13 '05 #6
Allen-

This worked, thanks so much for the help! I have a much greater
understanding of this now.

Scott

Nov 13 '05 #7

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

Similar topics

9
by: Warren | last post by:
I am trying to create a report that does the following: Access Data in Query: NAME | DATE | SALE TYPE | ------------------------- John DOE | 1282003 | TYPE A Jane DOE | 1282003 | TYPE C...
2
by: Kailey11 | last post by:
This probably is a basic question for most of you, but I am setting up an very simple database - person, date traveled, location and milage - using ACCESS 2000 and I want to add up the milage in...
2
by: ABinBoston | last post by:
I have an Access Application that I would like to have a report print on pre-printed Invoices. The Totals are in the Footer, but the report prints a different size depending on the number of...
6
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...
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: Cary Carter | last post by:
I'm trying to SUM the CountOf field totals in a report. In a report based on a select query that uses CountOf{fieldname} I am attempting to get the SUM totals of the X number of count totals. ...
2
by: hanshirley88 | last post by:
Hi, I am doing an expense and funding report which contains a list of consumers by Region and then by SiteID. For example, Region: NE Site: NEMV 1. Mary Doe 2. Len Willams
0
by: beebelbrox | last post by:
Greetings all. Once more I must dip into the font of your collective wisdom and request help: I have been given the task of taking an exsisting Access Query and exporting it to excel. There...
14
ollyb303
by: ollyb303 | last post by:
Hi, I am trying to create a dynamic crosstab report which will display number of calls handled (I work for a call centre) per day grouped by supervisor. I have one crosstab query (Query1) which...
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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
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,...

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.