How to limit number of record in report?

G

ghost

Greeting,

I have 100 records and I need them to by grouped 20 records per page of
report. In other word, how to make each page has 20 records only
How to do that please?
 
K

Ken Sheridan

Add a text box to the detail section. Name it something like txtCounter.
Set its ControlSource property to =1, its RunningSum property to Over All,
and its Visible property to False (No). As the control is hidden it can be
anywhere in the detail section, even on top of a visible control.

Add a Page Break control at the very bottom of the detail section.

In the detail secion's Format event procedure put a line of code like this:

Me.YourPageBreakControl.Visible = (Me.txtCounter Mod 20 = 0)

The Mod operator will return zero at each twentieth record, which will mean
the expression in parentheses will evaluate to True. This will set the
Visible property of the page break control to True. A page break control
only has effect when its Visible property is True, so a new page will be
started after each twentieth record.

Ken Sheridan
Stafford, England
 

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