Programmatically Control the Paper Source


You’d like to be able to print the first page of your reports from a paper tray containing letterhead paper and then print the rest on normal paper stock. Is there some way in Access to switch paper trays programmatically from within your application?


The paper source is one of the properties of the Printer object associated with a report (see Section 5.4.2 for a description of the Printer object) that you can programmatically control. Given the information in Section 5.4.2 , it’s relatively easy to change the paper source for a report so that the first page prints from one paper bin and the rest prints from another.

Load and run frmPaperSource in 05-05.MDB (Figure 5-5).

frmPaperSource allows you to print from different paper sources

Figure 5-5. frmPaperSource allows you to print from different paper sources

  1. With frmPaperSource loaded, choose a report. The report will load, minimized, in preview mode.

  2. Choose a paper bin for the first page and a bin for the rest of the pages. Note that the lists of paper bins contain all the possible paper sources; your printer may not support all of the options listed in the combo boxes. You’ll need to find the bins that work correctly with your printer driver.

  3. Click the Print button. Access should print the first page of the report from the bin chosen for the first page and the rest from the bin chosen for the other pages.

To use this technique in your ...

Get Access Cookbook now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.