A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Report works but then fails when used as a Sub-Reportsource



 
 
Thread Tools Display Modes
  #1  
Old August 2nd, 2007, 06:05 PM posted to microsoft.public.access.reports
Brian Ronan
external usenet poster
 
Posts: 1
Default Report works but then fails when used as a Sub-Reportsource

Hi, sorry if this sounds too easy or stupid, I've been trying for a couple of days now to get this to work and I've read a lot on here so hopefully didn't miss anything.

I have a report that basically draws fields out of a table and displays them, nothing fancy. I need it to print 8 and then page break, again no problem as a report - it works. Now the main report has 5 of these sub reports and I figured I would work with it one at a time to get it right and eliminate re-doing a lot of work. When I use the report as the sub report source there are no page breaks and the report is only one page - shows 23 of the 26 records. If I link the master/child items I get one record only and still one page. I have the page break in the sub report detail and the code is as follows (found in the OnFormat portion):

If Me![txtCount] Mod 8 = 0 Then Me![PGBK].Visible = True _
Else Me![PGBK].Visible = False

I'm at a loss. I would have thought a working report could be used as a sub report with no tweaking. I thought worst case I would need to move the page break to the main report but still check on the number of records placed in the sub report. Any ideas?

EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com
  #2  
Old August 3rd, 2007, 03:48 AM posted to microsoft.public.access.reports
Marshall Barton
external usenet poster
 
Posts: 5,361
Default Report works but then fails when used as a Sub-Report source

Brian Ronan wrote:

Hi, sorry if this sounds too easy or stupid, I've been trying for a couple of days now to get this to work and I've read a lot on here so hopefully didn't miss anything.

I have a report that basically draws fields out of a table and displays them, nothing fancy. I need it to print 8 and then page break, again no problem as a report - it works. Now the main report has 5 of these sub reports and I figured I would work with it one at a time to get it right and eliminate re-doing a lot of work. When I use the report as the sub report source there are no page breaks and the report is only one page - shows 23 of the 26 records. If I link the master/child items I get one record only and still one page. I have the page break in the sub report detail and the code is as follows (found in the OnFormat portion):

If Me![txtCount] Mod 8 = 0 Then Me![PGBK].Visible = True _
Else Me![PGBK].Visible = False

I'm at a loss. I would have thought a working report could be used as a sub report with no tweaking. I thought worst case I would need to move the page break to the main report but still check on the number of records placed in the sub report. Any ideas?



Since the main report is "in charge" of pagination, the
subreport Page event and page break controls are ignored.

For some reason, the ForceNewPage property does work in
subreports, so I think you can use:

Me.Section(0).ForceNewPage = (Me![txtCount] Mod 8 = 0)

--
Marsh
MVP [MS Access]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:24 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.