forcing a page break when less data than usual is on page

  • Thread starter Thread starter MattE
  • Start date Start date
M

MattE

I'm making a report that will only show the top three competitors in
each class, one class (three competitors max) per page. It works fine
when there are at least three in the class (it puts the next class on
the next page).

But when there are only one or two in a class it doesn't do a break
afterward and the following class gets put on the same page. How can I
force a break between classes even when there aren't at least three
competitors?

Hope this is clear. Thanks for any ideas!

Matt
 
MattE said:
I'm making a report that will only show the top three competitors in
each class, one class (three competitors max) per page. It works fine
when there are at least three in the class (it puts the next class on
the next page).

But when there are only one or two in a class it doesn't do a break
afterward and the following class gets put on the same page. How can I
force a break between classes even when there aren't at least three
competitors?


No, not clear.

How are you limiting each class to 3 records?

How are you getting a new page after 3 records?

If I have to guess, I'd say you are using an event procedure
to count records and using that to control the pagination.
If that is even slightly close, you should not do it that
way. Instead, create a group with header on the class
field. You can then set the group header section's
ForceNewPage property to Before Section to get the new page.
 
Thanks, Marshall! The group header ForceNewPage did wonders to
separate the classes.

I also need to continue to use the Detail Format event to quit printing
each class after three since I'm only showing the top three scores in
each class, unless there's a better way.

Thanks again for your help!

Matt
 
The recommended way to limit records (report or otherwise)
is to do it in the record source query. IMO, the query
would then be more compex than doing it in the report. To
do it in the report, use an =1 RunningSum text box Over
Group to count the records. The Detail section's Format
event would simply be:

Cancel = (txtCounter > 3)

I think(?) doing it in the record source query might have
better performance if there are a LOT of records and the
table has all the right fields indexed.
 

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

Back
Top