Skip to content

Latest commit

 

History

History
52 lines (33 loc) · 2.09 KB

Access.DoCmd.PrintOut.md

File metadata and controls

52 lines (33 loc) · 2.09 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
DoCmd.PrintOut method (Access)
vbaac10.chm4166
vbaac10.chm4166
Access.DoCmd.PrintOut
3b7c1ab7-1a60-cab3-2d4e-c95d6b5bd4aa
03/07/2019
medium

DoCmd.PrintOut method (Access)

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

Syntax

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 An 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 An 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.

Remarks

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

Example

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

DoCmd.PrintOut acPages, 1, 4, , 2

[!includeSupport and feedback]