ACC: Explanation of HasContinued and WillContinue Properties
ID: Q141622
|
The information in this article applies to:
-
Microsoft Access versions 7.0, 97
SUMMARY
Moderate: Requires basic macro, coding, and interoperability skills.
This article explains the HasContinued and WillContinue properties that are
included in Microsoft Access 7.0 and 97, their usage, and their
limitations.
MORE INFORMATION
HasContinued and WillContinue are report section properties that you can
inspect to determine if part of a section has printed on the previous page
or if part of a section will be printed on the next page.
You can either use the section name (as defined in the properties sheet)
when referring to these properties:
Me.Detail.WillContinue
Or you can reference the report's Section property:
Me.Section(0).WillContinue
HasContinued is set when the Format event for the section occurs and
evaluates to True if a portion of the current section was printed on the
previous page. Because the Format event occurs prior to the Print event,
HasContinued is only set to True if the FormatCount > 1 (the portion of the
section on the next page is being formatted). Because of this, you can't
determine if the detail section "has continued" by checking the
HasContinued property in page header or page footer events. HasContinued is
only useful when inspecting the property from within the section's own
event procedures.
WillContinue is set when the Print event for the section occurs and
evaluates to True if a portion of the current section will be printed on
the next page. It remains True until the same section's next Print event
occurs (PrintCount > 1). Therefore, you can check the detail section's
WillContinue property in page header or page footer events.
Following are steps to toggle the Visible property of a "Continued from
previous page" label in the page header and a "Continued on next page"
label in the page footer using the WillContinue property:
- Add a label control to a report's page header and set the following
properties:
Name: ContinuedFrom
Caption: Continued from previous page
Visible: No
- Add a label control to a report's page footer and set the following
properties:
Name: ContinuedOn
Caption: Continued on next page
Visible: No
- Type the following lines for the detail section's OnPrint event
procedure:
Me![ContinuedFrom].Visible = Me.Section(0).WillContinue
Me![ContinuedOn].Visible = Me.Section(0).WillContinue
NOTE: These properties can return unexpected results if the section's
KeepTogether property is set to No. With the KeepTogether property set to
No, the section may break between pages at any point in the section:
between controls, before the first control, or after the last control. This
may cause a small portion of the section to be printed on one page or the
other that doesn't actually contain a control. The HasContinued and
WillContinue properties will be set to True even if a section is split
across a portion that doesn't contain a control. To minimize this effect
do not leave any blank space at the top or bottom of the section.
REFERENCES
For more information about the WillContinue property, search the Help Index
for "WillContinue," or ask the Microsoft Access 97 Office Assistant.
For more information about the HasContinued property, search the Help Index
for "HasContinued," or ask the Microsoft Access 97 Office Assistant.
Keywords : kbusage RptLayou
Version : 7.0
Platform : WINDOWS
Issue type : kbinfo
Last Reviewed: April 23, 1999