Limit number of detail records per page

  • Thread starter Thread starter larry.abell
  • Start date Start date
L

larry.abell

I have a form that will only hold 8 detail records per page to retain
formatting. If there are more than 8 detail records, the formatting spans
pages which I do not want. I need to know when I am at 8 records, print the
footer, page break and create a new header, and resume printing the detail
records.

Any ideas? This sounds easy, but I'm stumped.
 
I have a form that will only hold 8 detail records per page to retain
formatting. If there are more than 8 detail records, the formatting spans
pages which I do not want. I need to know when I am at 8 records, print the
footer, page break and create a new header, and resume printing the detail
records.

Any ideas? This sounds easy, but I'm stumped.

Add an unbound control to the Detail section.
Set it's Control Source to:
=1
Set it's Running Sum property to:
OverAll
Name this control CountLines.
You can make it not visible if you don't wish to show it.

Add a Page Break control to the bottom of the detail section.

Code the Detail Format event:
PageBreakName.Visible = CountLines Mod 8 = 0
 
Larry,
You didn't mention whether the vertical height of 8 records is constant,
and... I'm not sure what you mena by "the formatting spans pages".
But... you should be able to just incresase the height of your page
footer so that it "imposes itself" and causes a page break after the 8
detail records. Just adjust the taller/shorter untill just 8 records will
fit on the page.
Use your Page header to repeat the header on each new page.
hth
Al Camp
 
Any idea how to stop reading detail recs print the footer and resume on the
next page. The code will print the footer, but all of the detail records
still print. I played with the cancel function, but then I miss the rest of
the records for that person.

An example of what I want to do is keep records for a person together, but
limit 8 to a page. Example: Person 1 has 10 detail records. I want the
following:

PERSON 1 HEADER
PERSON 1 DETAIL 1
PERSON 1 DETAIL 2
PERSON 1 DETAIL 3
PERSON 1 DETAIL 4
PERSON 1 DETAIL 5
PERSON 1 DETAIL 6
PERSON 1 DETAIL 7
PERSON 1 DETAIL 8
PERSON 1 FOOTER

NEXT PAGE
PERSON 1 HEADER
PERSON 1 DETAIL 9
PERSON 1 DETAIL 10
PERSON 1 FOOTER
 
Back
Top