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

B

Brian Ronan

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
 
M

Marshall Barton

Brian said:
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top