Solved

subform value

Posted on 2012-12-20
4
234 Views
Last Modified: 2013-01-06
I have a report called Charges_Rpt that contain two subreports

SRpt_supplies
Srpt_services

each one of the subreport has total charges.

total_supplies
total_services

 what I have the charges_rpt is a filed of grand total from both subreport. it works good when I have value in both sub reports but when one of them has blank data, the subreport does not show but the sum in the charge report would give me error

Grand_Total
0
Comment
Question by:the_Apple
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 29

Expert Comment

by:IrogSinta
ID: 38711791
Use the NZ function in whatever field could have a null value.  For example:
Nz([Amount],0)
The above will return a zero whenver a field has no value.
0
 
LVL 74

Assisted Solution

by:Jeffrey Coachman
Jeffrey Coachman earned 500 total points
ID: 38712007
Depending on your report design, (Grouped Report with GT in the group footer)
You can also use IsError() for the missing (no sum) subreport

The syntax can get a little intimidating, but it basically says if the subreport contains no data, it may not display, If that is the case, it is not null, it just does not exist, and #Error is returned for any math operation concerning the missing value .
So wrapping it in IsError, you can force it to return Zero
    =IIF(IsError([Something]),0,[Something])

Sample attached, see rptEmployees

JimD also has another technique using a Function:
http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_26786795.html

JeffCoachman
Access-EEQ-27974958SubFormSubRep.mdb
0
 

Author Comment

by:the_Apple
ID: 38737579
Hi all,

=NZ([Temp_Radiology subreport].[Report]![GrandTotal],0)+NZ([TBL_PRICER_JHH subreport].[Report]![AccessTotalsAMT],0)

it worked only in a layout view, when I run it to report preview or print. it shows error.

Any help or suggestions.
0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 500 total points
ID: 38737691
<layout view>
Don't you mean "Report View?
This is why I don't like the way the new "Views" are dealt with in the newer versions of Access.
When you first create a "Quick" report in Access, it opens in "Layout View" (the same thing happens with forms)
But clicking on the View button will bring you to "Report View"
This is why I never use Report View.
AFAIC, the only advantage Report View offers is; some limited "Interaction" (filtering, clicking on controls, ...etc) , and moderately lower system resource use.

I only use Print Preview because it will give you the best representation of exactly what the report will look like when actually "printed" (Hardcopy)

In this case IsError(), or Jim's function should work in any View.

The ultimate issue here is that if a sub-report has no value in may not be "Null", ...it just "does not exist"

JeffCoachman
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question