ACC2: PrtDevMode Settings Do Not Work Under Windows 95

Last reviewed: May 12, 1997
Article ID: Q140286
The information in this article applies to:
  • Microsoft Access version 2.0

SYMPTOMS

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

CAUSE

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

RESOLUTION

If 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 INFORMATION

If 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 Type

Replace 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 * 64

to read:

   RGB As String * 512

REFERENCES

For 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
               Orientation

For more information about the PrtDevMode Property, search for "PrtDevMode," and then "PrtDevMode" topic using the Microsoft Access Help menu.


Keywords : kbprint PtrSetup
Version : 2.0
Platform : WINDOWS
Hardware : X86
Issue type : kbprb
Resolution Type : kbcode


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: May 12, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.