Export (0) Print
Expand All
Expand Minimize

DoCmd.PrintOut Method (Access)

The PrintOut method carries out the PrintOut action in Visual Basic.

expression .PrintOut(PrintRange, PageFrom, PageTo, PrintQuality, Copies, CollateCopies)

expression A variable that represents a DoCmd object.

Parameters

Name

Required/Optional

Data Type

Description

PrintRange

Optional

AcPrintRange

A AcPrintRange constant that specifies the range to print. The default value is acPrintAll.

PageFrom

Optional

Variant

The first page to print. A numeric expression that's a valid page number in the active form or datasheet. This argument is required if you specify acPages for the printrange argument.

PageTo

Optional

Variant

The last page to print. A numeric expression that's a valid page number in the active form or datasheet. This argument is required if you specify acPages for the printrange argument.

PrintQuality

Optional

AcPrintQuality

A AcPrintQuality constant that specifies the print quality. the default value is acHigh.

Copies

Optional

Variant

The number of copies to print. If you leave this argument blank, the default (1) is assumed.

CollateCopies

Optional

Variant

Use True (–1) to collate copies and False (0) to print without collating. If you leave this argument blank, the default (True) is assumed.

You can use the PrintOut action to print the active object in the open database. You can print datasheets, reports, forms, data access pages, and modules.

The following example prints two collated copies of the first four pages of the active form or datasheet:

DoCmd.PrintOut acPages, 1, 4, , 2
Show:
© 2014 Microsoft