I need a page break after 5 records. I inserted a page break and made it invisible.
See below. Then I setup up the condition to make the page break visible. Results not as expected. I added a textbox [RecCounter] that counts each record 1, 2, 3, 4, etc. In my test example I have a total of 10 records.Code:Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As Integer) Me![PageBreak62].Visible = False End Sub
1) I would expect the page break to work if >5. But I need > 4 for it to create a page break after 5 records. Just curious, why doesn't >5 work for 5 records.
2) The page breaks after 5 records, but all pages thereafter have 1 record per page because the [RecCounter] doesn't reset to count 1, 2, 3, etc. It's still counting the Running Sum Over All. I set it to Count Over the Group, but still it counts 0-10 on all 10 records. So, how do I get it to only count the records on that page?
thanks!Code:Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) If Me![RecCounter] > 4 Then Me![PageBreak62].Visible = True End If End Sub


Reply With Quote

