O'Reilly logo

Access Cookbook, 2nd Edition by Andy Baron, Paul Litwin, Ken Getz

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required