My report has a detail section consisting of 35 questions. I want to insert a page break after questions 20, 25 and 30. How can I accomplish this? FYI - There is no grouping on the report.
I don't have much expertise in Access reports but since your thread wasn't getting any response I thought I'd give this problem a shot. I found an idea in this thread that might work in your case if modified a bit. You can see what I've come up with in the attached database. In that thread it says
It uses a text box with control source: =1, and running sum: over group, called txtRowCount, which can be hidden
I don't understand what that means so in my implementation I added an expression to the record source query of the report (qryReportRecordSource in the attached database) named CurrentRow which is:
This sequentially numbers the records in the order of ID. If in your case the field that determines the order is a text field your would need to add single quotes to this. Let say the fields name is QuestionNumber then this expression would look like
Note: If you understand what they are doing in that thread that might be a better way of doing this.
The CurrentRow expression was added to the report as a hidden textbox. Then in the On Format event of the Detail section I added the following code.
Code:
If Me.CurrentRow = 20 Or Me.CurrentRow = 25 Or Me.CurrentRow = 30 Then
Detail.ForceNewPage = 2 ' after section
Else
Detail.ForceNewPage = 0 ' none
End If
To get to this event you open the report in design view, click on the detail bar to select it, open the Property Sheet (if not open already),in the Event tab click on On Format and click on the ellipsis on the right.
I would say a "bit" un-normalized for transaction data entry.
Also the fact there is no grouping makes me think this is data coming from a single record in the detail section.
Reporting is easier with de-normalized / flattened /spreadsheet data.
The data could be coming from Excel or some other source. Access may not be used for the data entry.
FWIW: I do lots of reporting with Access from sources I didn't create or have control over. Sometimes I deal with exports into CSV or Excel format from other applications. I use this as the back end (data source) for my reports. . I don’t worry about normalizing the data. That way I don’t have to turn around and create a query to flatten it back out like it was originally.
I know this is an old post. Just came to say I recently (today) kept trying to set the height of the Report Footer with a Page Break knowing it was going to be tricky. THEN I come across this and realize, right, I just need to control the Page Break. Some days I just need more coffee.