ACC2000: Incorrect PrtMip Example in Help

ID: Q208331


The information in this article applies to:


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

This article applies to a Microsoft Access database (.mdb) and a Microsoft Access project (.adp).


SYMPTOMS

When you use the PrtMip property example in Help, you may receive the following error message:

Compile Error:
Method or data member not found


CAUSE

The Help example contains errors in the name of the elements used in the subroutines for these procedures.


RESOLUTION

Use the following procedures in your module instead of the ones provided in the Help example:


Sub PrtMipCols(strName As String)
    Dim PrtMipString As str_PRTMIP
    Dim PM As type_PRTMIP
    Dim rpt As Report
    Const PM_HORIZONTALCOLS = 1953
    Const PM_VERTICALCOLS = 1954
    DoCmd.OpenReport strName, acDesign
    Set rpt = Reports(strName)
    PrtMipString.strRGB = rpt.PrtMip
    LSet PM = PrtMipString
    ' Create two columns.
    PM.cxColumns = 2
    ' Set 0.25 inch between rows.
    PM.xRowSpacing = 0.25 * 1440
    ' Set 0.5 inch between columns.
    PM.yColumnSpacing = 0.5 * 1440
    PM.rItemLayout = PM_HORIZONTALCOLS
    
    LSet PrtMipString = PM            ' Update property.
    rpt.PrtMip = PrtMipString.strRGB
End Sub 

Sub SetMarginsToDefault(strName As String)
    Dim PrtMipString As str_PRTMIP
    Dim PM As type_PRTMIP
    Dim rpt As Report
    DoCmd.OpenReport strName, acDesign
    Set rpt = Reports(strName)
    PrtMipString.strRGB = rpt.PrtMip
    LSet PM = PrtMipString
    PM.xLeftMargin = 1 * 1440    ' Set margins.
    PM.yTopMargin = 1 * 1440
    PM.xRightMargin = 1 * 1440
    PM.yBotMargin = 1 * 1440
    LSet PrtMipString = PM            ' Update property.
    rpt.PrtMip = PrtMipString.strRGB
End Sub 


STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.


MORE INFORMATION

Steps to Reproduce Behavior

  1. Open the sample database Northwind.mdb.


  2. Press ALT+F11 to open the Visual Basic Editor.


  3. Click Microsoft Visual Basic Help on the Help menu, type PrtMip property in the Office Assistant or the Answer Wizard, and then click Search.


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


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


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


  7. Type the following line in the Immediate window, and then press ENTER:
    
    PrtMipCols("Customer Labels") 
    Note that you receive the error message mentioned at the beginning of this article.


Additional query words: pra


Keywords          : kberrmsg kbdta DcmHlp 
Version           : WINDOWS:2000
Platform          : WINDOWS 
Issue type        : kbbug 

Last Reviewed: May 13, 1999