ACC: How to Change a Report's Printer Using CodeLast reviewed: October 13, 1997Article ID: Q129397 |
The information in this article applies to:
SUMMARYAdvanced: Requires expert coding, interoperability, and multiuser skills. You can change the printer for a report or form in two ways:
MORE INFORMATION
Method 1: Changing the Microsoft Windows Default PrinterIn the Page Setup (or Print Setup in version 2.0) dialog box, you can choose whether forms or reports are printed by either a default printer or a specific printer. If you choose a default printer, the form or report is printed to the Microsoft Windows default printer. If you want to change to another default printer, you must change the Microsoft Windows default printer. To change the Microsoft Windows default printer using Visual Basic code (or Access Basic code in version 2.0 or earlier), use WriteProfileString to change the Device= entry of the Microsoft Windows section of the Win.ini file.
Method 2: Setting the PrtDevNames and PrtDevMode propertiesThe PrtDevNames property stores the name of the printer, and the PrtDevMode property stores the driver information. Both of these properties need to be changed in order to change the printer driver. If the PrtDevMode property does not match the PrtDevNames property (that is, the PrtDevMode property describes a different driver than the PrtDevNames property) a General Protection (GP) Fault may occur. To change the printer driver, you must do the following:
REFERENCESFor more information about PrtDevMode and PrtDevNames, search for "PrtDevMode property" or "PrtDevNames property," using the Microsoft Access 97 Help Index or please see the following web site:
http://www.microsoft.com/AccessDev/Articles/GetzCh10.HTMFor more information about WriteProfileString, the Win.ini, and the Default Printer in Windows 95, consult the Microsoft Developers Network CD-ROM (MSDN). Keywords : PtrSetup kbprint Version : 1.0 1.1 2.0 7.0 97 Platform : WINDOWS Hardware : x86 Issue type : kbhowto |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |