Print Extra Copies

There might be times when you need to print copies of a particular record on your form. The following code attached to the OnClick event of a command button on a form performs the task:

RunCommand acCmdSelectRecord 
DoCmd.PrintOut acSelection, , , , 3 

This function uses the RunCommand method with the intrinsic constant acCmdSelectRecord to carry out the Select Record command from the Edit menu on the menu bar, which selects the current record. Then, the PrintOut method of the DoCmd object, having the PrintRange argument set to acSelection, prints the selected record. The fifth argument in the PrintOut method instructs the printer to print three copies. You also can use the PrintOut method to print page ranges. Because you ...

Get Access 2002 Programming by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.