PrintCount Property

Applies To

Report.

Description

You can use the PrintCount property to identify the number of times the OnPrint property has been evaluated for the current section of a report.

Setting

You can use this property only in a macro or an event procedure specified by a section’s OnPrint property setting.

The PrintCount property setting has a Long data type value.

This property isn’t available in Design view and is read-only in all other views.

Remarks

Microsoft Access increments the PrintCount property each time the OnPrint property setting is evaluated for the current section. As the next section is printed, Microsoft Access resets PrintCount property to 0.

The PrintCount property is incremented, for example, when the KeepTogether property is set to No for the current section and the section is printed on more than one page. If you print a report containing order information, you might keep a running total of the order amounts. The following example shows how you can use the PrintCount property to make sure the value of each order is added only once.


If Reports![MyReport].PrintCount = 1 Then
    RunningTotal = RunningTotal + OrderAmountIf

See Also

Event Properties, FormatCount Property, Print Event.