473,670 Members | 2,307 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sub Report Problem

13 New Member
Hi,

Explain:

I have a report for reciept list , it contain 3 sub report.
1st for cash and it contain sub total 1
2nd for check and contain sub total 2
3rd for Credit card and contain sub total 3

and in the main report i put :
total = nz(sub total 1)+nz(sub total 2)+nz(sub total 3)

Problem:

it give me the right total when the list contain the 3 sub totals.
But
the main problem appear when the list have only cash , the sub report of cach appear only , thats logic, but the total in the main report give me "# Error"
because the 2 other sub report not appear.

plz can anyone give to me any solution for that.

Note: Access 2003

regards

Zaher Rabah
May 15 '07 #1
9 1959
MMcCarthy
14,534 Recognized Expert Moderator MVP
You have posted in the Articles section. I am moving this question to the Access forum.

ADMIN
May 15 '07 #2
NeoPa
32,569 Recognized Expert Moderator MVP
I'm not sure I can help you here, but just in case :
What do you mean when you say that the other sub-reports 'don't appear'?
Are they invisible perhaps?
May 15 '07 #3
Zaher Rabah
13 New Member
I'm not sure I can help you here, but just in case :
What do you mean when you say that the other sub-reports 'don't appear'?
Are they invisible perhaps?
yes, they are invisible bc their is no data in them.

Example:

This case happen when a client come and pay only cash, so the 2 sub report are empty and invisible.
May 16 '07 #4
dima69
181 Recognized Expert New Member
I am familiar with this problem. My solution is this:
1. In the main report module write a function
Expand|Select|Wrap|Line Numbers
  1. Function GetSubTotal(SubFRM as String) as Currency
  2. On Error Goto Err1
  3. GetSubTotal = Me(SubFRM)![sub total]
  4. exit function
  5. err1:
  6. GetSubTotal = 0
  7. end function
2. At the main form, put calculated field like this:
Expand|Select|Wrap|Line Numbers
  1. =GetSubTotal("SubFRM1")+GetSubTotal("SubFRM2")+GetSubTotal("SubFRM3")
May 16 '07 #5
NeoPa
32,569 Recognized Expert Moderator MVP
yes, they are invisible bc their is no data in them.

Example:

This case happen when a client come and pay only cash, so the 2 sub report are empty and invisible.
I'm really trying to ask 'how' they are invisible here. On which objects (if any) do you set the visible property to False?
If an object (control) were simply devoid of data I can't see why the Nz() would fail to return a valid result.

I'm not trying to raise your hopes, as I can't see a solution anyway (if all you've said so far is true), but I think if it's clearer what you're talking about you may get lucky with someone else.
May 16 '07 #6
dima69
181 Recognized Expert New Member
I'm really trying to ask 'how' they are invisible here. On which objects (if any) do you set the visible property to False?
If an object (control) were simply devoid of data I can't see why the Nz() would fail to return a valid result.

I'm not trying to raise your hopes, as I can't see a solution anyway (if all you've said so far is true), but I think if it's clearer what you're talking about you may get lucky with someone else.
The subreport is invisible because it has no data (even report's footer and header are invisible) - that's just the way it works. And there is no way to address any objects on that invisible subreport - as it does not exist at all. So you cannot just use NZ because any reference to empty subreport will produce an error.
As for the solution - see my post above :)
May 16 '07 #7
NeoPa
32,569 Recognized Expert Moderator MVP
Nice one Dima :)
I didn't realise it worked that way (I don't use sub-reports much as you can probably guess).
Thanks for getting my back on this one.
May 16 '07 #8
dima69
181 Recognized Expert New Member
Nice one Dima :)
I didn't realise it worked that way (I don't use sub-reports much as you can probably guess).
Thanks for getting my back on this one.
Any time :)
May 16 '07 #9
Zaher Rabah
13 New Member
I am familiar with this problem. My solution is this:
1. In the main report module write a function
Expand|Select|Wrap|Line Numbers
  1. Function GetSubTotal(SubFRM as String) as Currency
  2. On Error Goto Err1
  3. GetSubTotal = Me(SubFRM)![sub total]
  4. exit function
  5. err1:
  6. GetSubTotal = 0
  7. end function
2. At the main form, put calculated field like this:
Expand|Select|Wrap|Line Numbers
  1. =GetSubTotal("SubFRM1")+GetSubTotal("SubFRM2")+GetSubTotal("SubFRM3")

Hi, Dima

Thank u for your help.

Regards

Zaher Rabah
May 17 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

2
2375
by: GC | last post by:
HI, I'am using Crystal Report with visual Studio .NEt 2003 When i make a report using a store procedure, I can not see all the fields of the store proc and i'm suppose to see those fields. I'm suppose to see a "+" sign at the left of the store procedure name in the Field Explorer section When we click on the sign "+" we see all the field of the store proc. We can from there select and drag those fileds on the report.
4
7045
by: deko | last post by:
I can't move a multi-page report to the last record unless I keep the popup form (that defined it's subreports) open. DoCmd.OpenReport "rptStandard", acViewNormal DoCmd.Close acForm, "frmReportOptions" <== popup form This is the error I get when I try to move to the last page of the report *after* closing the popup: "This expression is typed incorectly, or is too complex to be evaluate...."
7
2622
by: xzzy | last post by:
I need to automate a report in a different database (and thank yous to Terry Kreft for pointing me in the right direction). below is the code with the one line that does not work, marked: 'Does not Work' It appears that the type of object returned from the "AllReports" collection is not a report object. =>> I need it to be an object of type report.
3
2731
by: ahaque38 | last post by:
Hello. Using A2K SP3, I am having the following problem with a report using "Sorting and Grouping". I have recently added a grouping in the reports for "Category2<>'CONTRACTS'". I have reports at the plan (overall totals), department and division levels which have sorting and grouping implemented with this new
2
2555
by: Rick Caborn | last post by:
I am having a problem with an Access 2000 report getting data from SQL Server 2000. Here are the specifications for it: RecordSource: a stored procedure (tested via query analyzer and working correctly - permissions properly set) InputParameters: just one - provided by a function call that is functioning properly When I run the report, it hits the Load event, runs the function to get
4
2803
by: Trevor Best | last post by:
I have a report that's fairly simple, page headers and footers, detail has a subreport in (can vary in length). The customer wanted a signature block for them, their client and 3rd party. This was no problem, couple of boxes and labels in the report footer. Now customer wants this signature block on the foot of page 1 (stoopid IMO as that implies people read page 1 where at the end implies they read past page 1 at least). Anyway to...
9
1773
by: MLH | last post by:
Trouble is, it doesn't happen every time. Yesterday, for example, it happened only once and not again afterward. Some days ago, a similar situation. Today, well - I tried 7 times straight to open the report and each time, A97 shuts down. The seemingly hit 'n miss nature of the error is intriguing. All I've been able to determine is that if I allow the report to be opened from within code using this line... DoCmd.OpenReport...
12
10396
by: Bill Nguyen | last post by:
What's the VB syntax to run the CR report using the following SP? I use CrystalreportViewer and ReportDocument. Thanks Bill Here's the SP in SQLserver 2K: CREATE proc mysp_ReportSubmission @salesdate as varchar(20),
7
4635
by: TC | last post by:
I've produced an Access application for a client. For one report, text gets cut-off at the right margin when we print the report. It does this only when we print; it doesn't happen when we view the report in preview mode. Also, it occurs only at the client site; it doesn't occur at my office or on any other computer I've tried. I can describe the problem best with a specific example. (This is a contrived example, but it is faithful to...
2
1925
by: =?Utf-8?B?UmljaA==?= | last post by:
On my development machine where I have Visual Studio 2005 loaded, I have an app that uses the Report control. I can view data in report format with the Report control -- the data renders OK in the Report control. My problem is in rendering the report from the rdlc file for printing to a line printer. Following the example from MSDN Help at http://msdn2.microsoft.com/en-us/library/ms252172(VS.80).aspx I can print the rdlc report...
0
8469
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8386
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8903
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8592
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7419
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6213
isladogs
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5684
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
2042
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1794
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.