Page Breaks for last 5 records

S

S

Hello,

I have a report that is grouped on [SessionNum] with many records under each
[SessionNum]. The records are sorted ascending by [EntryNum].
What I would like to do is insert a page break on the last 5 records of each
[Session].

Is there cody that could be written for this?
 
M

Marshall Barton

S said:
I have a report that is grouped on [SessionNum] with many records under each
[SessionNum]. The records are sorted ascending by [EntryNum].
What I would like to do is insert a page break on the last 5 records of each
[Session].


Strange thing to do, but not all that difficult.

Add a text box (named txtLineNum) to the detail section.
Set its expression to =1 and RunningSum to Over Group.

Add another text box (named txtDetailCnt) to the group
header section. Set its expression to =Count(*)

Add a Page Break control (named pgBreak) to the top of the
detail section.

Add a line of code to the detail section's Format event
procedure:
Me.pgBreak.Visible = (Me.txtLineNum = (Me.DetailCnt - 5))
 

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