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

Question about reports, subreports, and page breaks

Folks,

I have four subreports in a report in the detail section. I suppose I
could move them to the footer of the report. Anyway, if any of them
have data, I want the main report to force a page break. I am trying
to use the "hasdata" property for the subreports, but I am getting the
generic error indicating property not available for object.

How does one tell the main report (using VBA) not to throw in a page
break unless the subreport has data? There has to be an easy set of
code for this. Thanks.

David

Sep 11 '06 #1
1 3556

David wrote:
Folks,

I have four subreports in a report in the detail section. I suppose I
could move them to the footer of the report. Anyway, if any of them
have data, I want the main report to force a page break. I am trying
to use the "hasdata" property for the subreports, but I am getting the
generic error indicating property not available for object.

How does one tell the main report (using VBA) not to throw in a page
break unless the subreport has data? There has to be an easy set of
code for this. Thanks.

David
Don't forget that you have to refer to the report property of the
subreport when determining whether or not the subreport has data, i.e.

MySubreport.Report.HasData

That being said, I am assuming you could put a page break control at
the end of your detail section and something like the following in the
detail_format event of your main report to force a page break if any of
the reports have data:

If MySub1.Report.HasData Or _
MySub2.Report.HasData Or _
MySub3.Report.HasData Or _
MySub4.Report.HasData Then
PageBreak.Visible = True
Else
PageBreak.Visible = False
End If

Note that 'telling the main report NOT to throw in a page break' if the
subreports have no data is something different than telling the main
report to throw in a page break if the subreports do have data and
would be a much more complicated affair if it could even be achieved at
all.

HTH,
Bruce

Sep 13 '06 #2

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

Similar topics

5
by: BStorm | last post by:
I have a transaction log file where the DataSet table's Description column is actually delimited into "subcolumns" based upon the transaction id. I would like to parse these into separate fields...
1
by: JW | last post by:
The problem of hiding / showing a sub reports on No Data is often asked, my problem here is a little different. My Main report has, as a page header, company details (so each company to a new...
5
by: Prakash Wadhwani | last post by:
I have a main Report with 3 sub-reports eg: Report1 (Main Report) ... SubRpt1, SubRpt2, SubRpt3 SubRpt1, SubRpt2 & SubRpt3 are bound to 3 different tables with a common relation on a NUMERIC...
6
by: NOSPAMrclark | last post by:
I'm wondering . . . . What is the generally accepted method for calling reports from multiple locations? Example: REPORT-A is called by selecting a record in a listbox and clicking a...
3
by: Brad | last post by:
I have just posted a variation of this question on the Crystal Reports board, but most times I do not get a reponse. I have a report in which I asked about yesterday and after working all day on...
3
by: joelpollock | last post by:
I'm having trouble continuously page numbering a large report in MS Access. The report is made up of three separate Access reports which I join together at the end. In the past I have opened the...
3
by: LataChavan | last post by:
I have tried to look for a solution to the problem of sending parameters to stored procedures through crystal report. Following is the code: Now what happens is that if i do not apply the logon...
3
by: Matt | last post by:
Hi All, I currently have 2 reports. One report shows Transaction History (I will refer to as "TH") and the other shows Account Summary (I will refer to as "AS"). I want to combine the reports...
10
by: glenfernandez | last post by:
HI there, Need a little help with the reporting component of my MS Access 2002 project and would appreciate any insight / help from the experts. Please bear with me as I am still learning Access...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
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
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
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...
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...

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.