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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

first page blank with keep together 1

Status
Not open for further replies.

rivkahannah

Programmer
Aug 5, 2003
6
0
0
US
Hi,

I am working on a report that groups readings to a particular data point. The users want each data point's data to be kept together as a group so if all the data doesn't fit on one page it will start on the next page. I set this up by setting the group to keep together as a whole group. This works fine except when the first data point has so much data that it can't fit on the first page. Access then makes the first page blank and starts printing the data on the second page. Does anyone know how to get around this?

Thanks in advance,
Rebekah
 
Did you try PAGE BREAK AFTER in the group function?

Jim DeGeorge [wavey]
 
I haven't set page breaks for before or after any of the groups in the report. I don't want to set the page break to after because I don't want it to always force a new page after every data point. The "keep together as whole group" is set in the sorting & grouping section of the report.
 
I finally solved the blank page problem by turning off the automatic keep together as whole group on the grouping level and manually set up grouping in code. I declared a private variable that recorded the number of rows printing on a page and placed a page break control in the detail section of the report. A text box that counts the number of total records was placed in the group header. In the on format event of the group header I entered an If statement that compared the total number of records for the group with the number of total potential records on a page and the number of records that have already printed on the page and if the group is less than the total number of total records for the page but greater than the remaining records, the page break becomes visible.

If txtCount < 27 And txtCount > (27 - iPageRecordCount) then
Me!PageBreak.Visible=True
End If

In the page header format section I reset the pageBreak control to visible = false. The only additionally useful item would be something that automatically counts the number of potential detail records for a page.
 
Congratulations! I never would have thought about that. Since you can't give yourself a star, I will. You deserve it!

Jim DeGeorge [wavey]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top