ACC: Incorrect PrtMip Example in Help

Last reviewed: April 1, 1997
Article ID: Q158924
The information in this article applies to:
  • Microsoft Access versions 7.0, 97

SYMPTOMS

Moderate: Requires basic macro, coding, and interoperability skills.

When you use the "PrtMip Property" example in Help, you may receive the following error message in Microsoft Access 7.0:

   The setting you entered isn't valid for this property

In Microsoft Access 7.0 and 97, the SetMarginsToDefault() sample procedure does not cause an error, but it does not produce the documented results.

CAUSE

The Help example contains errors in the declarations of the two Type statements required for this procedure to work.

RESOLUTION

Use the following as the Type statements in the Declarations section of your module instead of what is in the Help example:

   Type str_PRTMIP
      RGB As String * 28
   End Type

   Type type_PRTMIP
      xLeftMargin As Long
      yTopMargin As Long
      xRightMargin As Long
      yBotMargin As Long
      fDataOnly As Long
      xWidth As Long
      yHeight As Long
      fDefaultSize As Long
      cxColumns As Long
      yColumnSpacing As Long
      xRowSpacing As Long
      rItemLayout As Long
      fFastPrint As Long
      fDatasheet As Long
   End Type

MORE INFORMATION

In Microsoft Access 7.0, the Help example declares a 56-character string in the Type str_PRTMIP statement. It is that statement which causes the error message. This documentation has been fixed in Microsoft Access 97.

The Help examples in both Microsoft Access 7.0 and 97 declare the elements in type_PRTMIP as Integer instead of Long. This does not cause an error message; however, the SetMarginsToDefault procedure in the Help example does not work unless you declare those elements as Long.

Steps to Reproduce Behavior

  1. Open the sample database Northwind.mdb.

  2. Search for the "PrtMip property" using the Microsoft Access Help Index.

  3. Click Example at the top of the PrtMip Property Help screen.

  4. Highlight the declarations and the first procedure at the top of the example, and then press CTRL+C to copy the text to the clipboard.

  5. Create a new module called PrtMipExample and press CTRL+V to paste the text into it.

  6. In Microsoft Access 7.0, type the following line in the Debug window, and then press ENTER:

           PrtMipCols("Catalog")
    

    Note that you receive he error message.

  7. In both Microsoft Access 7.0 and 97, type the following line in the Debug window, and then press ENTER:

          SetMarginsToDefault("Catalog")
    

    The Catalog report opens in Design view. Select the Catalog report, and then click Page Setup on the File menu. In both Microsoft Access 7.0 and 97, note that the top, bottom, left, and right margins are not set to 1" all the way around as stated in the Help example.


Keywords : DcmHlp kberrmsg
Version : 7.0 97
Platform : WINDOWS
Hardware : X86
Issue type : kbdocerr


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: April 1, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.