Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

One Report with 10 Subreports

Status
Not open for further replies.

regava

Programmer
May 24, 2001
152
US
Access 2000 - I have a report that has 10 subreports. The conditions are: 1) each subreport must start on a new page, 2) no blank pages.
When I placed a pagebreak between subreports in the main report I got blank pages if there was no data for that report (on the ON NO DATE event I set CANCEL = TRUE). When I removed the pagebreaks each subreport run continuously instead of starting in a new page. I tried to insert pagebreak in the header of each subreport - no change. I have the Can Shring and Can Grow properties of each subreport set to Yes. Any Ideas? thank you.
 
Assuming your pagebreak controls are named: pgbrk1, pgbrk2,... and your subreports are named: subrpt1, subrpt2,... add code to your report section like:
Code:
Me.pgbrk1.visible = Me.subrpt1.Report.HasData
Me.pgbrk2.visible = Me.subrpt2.Report.HasData

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
dhookom, thanks.
My Report looks as follows
Report Header
......
Page Header
Details
subrpt0
pagebreak1
subrpt1
pagebreak2
subrpt2
pagebreak3
subrpt3
.
.
.
subrpt9
Page Footer
....
Report Footer
Where do I place your code? Keep in mind that by the time subrpt1 is ready we have already past pagebreak1. Also I was testing using the code in the Report Header section of each subreport and did not work. Any Ideas?
 
Place the code in the On Format event of the main report section containing the pagebreaks and subreports. Don't worry about the timing as long as the code and controls are in the same report section.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
dhookom, It worked. Thanks a millon for yoyr help. It is appreciated.
 
Doggone it Duane, I LOVE the way you do Me.pgbrk1.visible = Me.subrpt1.Report.HasData! I keep thinking about IF...THEN.
Explains why you are da MVP. Might be time to leave Madison and head up to Eau Claire for work...


When everything is coming your way, you're in the wrong lane.
 
Genomon,
Did I know you were in Madtown? Am I just getting old an forgetfull?

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Duane-
Nope, I have visited your website and shamelessly helped myself to downloads in the past. Good to know there are still a few "Sconnies" in the forum!

Sure, the early bird gets the worm, but the second mouse gets the cheese in the trap.
 
For Duane:
Sorry to corrupt the thread, but the links at don't seem to do anything; annoyingly, the "contact us" at the bottom of the page. Noticed the CP plea, and will be happy to contribute.
If you can reply, do so at and send mail to Dick Bauer - he will be sure that i receive it. Thanks for donating your time for a great cause, and your resources to the programming community!
[thumbsup2]

Sure, the early bird gets the worm, but the second mouse gets the cheese in the trap.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top