Chapter 5. Printers

Printing output is a major component of any database product, and Access gives you a great deal of control over the “look” of your forms and reports. Programmatic control over the printer itself, however, has always been somewhat complex in Access. Windows provides rich and intricate support for output devices, and Access attempts to shield you from most of that intricacy. Sometimes, however, you do need to take control of your output devices; for example, you may need to change a particular device or a setting pertaining to a particular device. Historically, Access made this possible but not easy. However, starting with Access 2002, you can use the Printers collection with a Printer object that makes it relatively easy to accomplish the most common printing tasks. The sections in this chapter describe the details of handling your output devices using these new objects.

This chapter focuses on the Printers collection and the associated Printer object. We’ll cover the properties of these objects in detail and show examples of their use. You’ll be able to retrieve a list of all the installed printers and make a choice from that list, setting the new default Access printer. You’ll learn how to modify margin settings in forms and reports, thereby avoiding the use of Access’s File Page Setup dialog in your applications. You’ll get help on changing printer options, such as the number of copies to print, the page orientation, and the printer resolution. Then you’ll ...

Get Access Cookbook, 2nd Edition 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.