Form Section, Report Section.
You can use the KeepTogether property to print a report section all on one page. For example, you might have a group of related information that you don’t want printed across two pages.
Note The KeepTogether property applies only to forms and reports sections (except page headers and page footers).
The KeepTogether property uses the following settings.
Setting |
Description |
Visual Basic |
Yes |
Microsoft Access starts printing the section at the top of the next page if it can’t print the entire section on the current page. |
True (-1) |
No |
(Default) Microsoft Access prints as much of the section as possible on the current page and prints the rest on the next page. |
False (0) |
You can set this property using the section’s property sheet, a macro, or Visual Basic.
You can set the KeepTogether property only in report Design view.
Usually, when a page break occurs while a section is being printed, Microsoft Access continues printing the section on the next page. Using the section’s KeepTogether property, you can print the section all on one page. If a section is longer than one page, Microsoft Access starts printing it on the next page and continues on the following page.
ForceNewPage Property, Format Event, KeepTogether Property — Groups.
This example returns the KeepTogether property setting for the report’s detail section and assigns the value to the intGetVal variable.
Dim intGetVal As Integer= Me.Section(0).KeepTogether