ACC2: PrtDevMode Settings Do Not Work Under Windows 95Last reviewed: May 12, 1997Article ID: Q140286 |
The information in this article applies to:
SYMPTOMSAdvanced: Requires expert coding, interoperability, and multiuser skills. When you run Microsoft Access version 2.0 under Windows 95, a database that uses an Access Basic procedure to set a form or report's PrtDevMode property doesn't change the Print Setup settings correctly. The same procedure works correctly when you run Microsoft Access 2.0 under Windows 3.x.
CAUSEThe PrtDevMode property mirrors the Windows DEVMODE structure. This structure has changed in Windows 95. Part of the process of changing a form or report's PrtDevMode property is to store the current PrtDevMode structure in a string variable. An application can use the zwtDevModeStr type defined in the WZFRMRPT wizard library if this library is being loaded. If the library is not being loaded, as is the case with a run-time application, a common alternative is to copy this type declaration from the Wizard module to the Declarations section of one of the application's modules. The string element RGB in this structure is defined as 64 bytes. The new DEVMODE structure requires this string to be larger.
RESOLUTIONIf your application does not contain this type declaration, include a new type declaration and change the references to the old structure. If your application already has this type declaration, change the size of the string element.
MORE INFORMATIONIf your application does not define this structure in the Declarations section of a module (you are using the wizard declaration), you need to add the type declaration to one of your application's modules. To do so, add the following lines to the Declarations section of one of your application's modules. This must be a stand-alone module.
Type str_DEVMODE RGB As String * 512 End TypeReplace all references to the old type structure zwtDevModeStr in your application code to the new type structure, str_DEVMODE. If the Declarations section of one of the modules in your application already contains this type declaration, change the line that reads
RGB As String * 64to read:
RGB As String * 512 REFERENCESFor more information about using PrtDevMode, please see the following articles in the Microsoft Knowledge Base:
ARTICLE-ID: Q129397 TITLE : ACC: How to Change a Report's Printer Using Code ARTICLE-ID: Q129748 TITLE : ACC: Using the PrtDevMode Property to Verify Custom Page Size ARTICLE-ID: Q129722 TITLE : ACC2: Using the PrtDevMode Property to Change Page OrientationFor more information about the PrtDevMode Property, search for "PrtDevMode," and then "PrtDevMode" topic using the Microsoft Access Help menu. |
Keywords : kbprint PtrSetup
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |