ACC2: Group KeepTogether Does Not Apply to Multi-Column ReportsLast reviewed: April 2, 1997Article ID: Q125234 |
The information in this article applies to:
SYMPTOMSModerate: Requires basic macro, coding, and interoperability skills. The group KeepTogether property does not apply to multiple-column reports as the "Creating Snaking Columns on a Report" online Help topic suggests. The Help topic states, in part:
To keep the first detail record with the group header, in the Sorting And Grouping box, set the KeepTogether Property--Groups for the group header to With First Detail.This statement is incorrect.
CAUSEIn a multiple-column report, the group KeepTogether property applies to the entire page, not to the individual columns.
RESOLUTIONTo avoid an abandoned group header at the bottom of a column, or to prevent a group header from being printed beyond a certain position on the page, use the following sample procedure as the event procedure for the group header's OnPrint property. Modify the expression "(5 * 1440)" in the procedure with the value beyond which you do not want a group header to be printed. Note that the expression "(5 * 1440)" equates to 5 inches, because there are 1440 twips in an inch. The sample procedure tests the report's Top property (the position where the report will be printed) and if the condition is true, causes the report not to be printed at that position but instead moves down the page until the condition is false, which occurs at the top of the next page. By default, the report's NextRecord and PrintSection properties are set to True after each attempt to print a section.
Sub GroupHeader3_Print (Cancel As Integer, PrintCount As Integer) If Me.Top > (5 * 1440) Then Me.NextRecord = False Me.PrintSection = False End If End SubNote that this procedure works well if the Item Layout option in the Print Setup dialog box for the columns is set to Vertical. If the Item Layout option is set to Horizontal, you may want to set the NewRowOrCol property for the group header section to Before & After.
STATUSMicrosoft Access version 7.0 includes a new report GrpKeepTogether property that specifies whether groups that have their KeepTogether property set to 'With First Detail' or 'Whole Group' will be kept together by page or column.
MORE INFORMATION
Steps to Reproduce Behavior
REFERENCESFor more information about the GrpKeepTogther Property, search for "GrpKeepTogether Property" using the Microsoft Access for Windows 95 Help Index.
|
Additional query words: multiple column keep together
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |