DoCmd.PrintOut acPages, firstpage#, lastpage#, , numberofcopies
From the help files:
PrintOut Method
See Also Applies To Example Specifics
The PrintOut method carries out the PrintOut action in Visual Basic.
expression.PrintOut(PrintRange, PageFrom, PageTo, PrintQuality, Copies, CollateCopies)
expression Required. An expression that returns one of the objects in the Applies To list.
PrintRange Optional AcPrintRange.
AcPrintRange can be one of these AcPrintRange constants.
acPages
acPrintAll default
acSelection
If you leave this argument blank, the default constant (acPrintAll) is assumed.
PageFrom Optional Variant. 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. 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.
AcPrintQuality can be one of these AcPrintQuality constants.
acDraft
acHigh default
acLow
acMedium
If you leave this argument blank, the default constant (acHigh) is assumed.
Copies Optional Variant. A numeric expression. 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
For more information on how the action and its arguments work, see the action topic.
You can leave an optional argument blank in the middle of the syntax, but you must include the argument's comma. If you leave one or more trailing arguments blank, don't use a comma following the last argument you specify.
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
=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)
Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+
w: rljohnso@stewart.com
h: wildmage@tampabay.rr.com