Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved.
Terms
of Use |
Trademarks
Article ID: 208331 - Last Review: June 24, 2004 - Revision: 2.0
ACC2000: Incorrect PrtMip Example in Help
This article was previously published under Q208331
Moderate: Requires basic macro, coding, and interoperability skills.
This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).
When you use the
PrtMip property example in Help, you may receive the following error message:
Compile Error:
Method or data member not found
The Help example contains errors in the name of the elements used in the subroutines for these procedures.
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
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
Steps to Reproduce Behavior
- Open the sample database Northwind.mdb.
- Press ALT+F11 to open the Visual Basic Editor.
- Click Microsoft Visual Basic Help on the Help menu, type PrtMip property in the Office Assistant or the Answer Wizard, and then click Search.
- Click Example at the top of the PrtMip Property Help screen.
- 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.
- Create a new module called PrtMipExample and press CTRL+V to paste the text into it.
- 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.
APPLIES TO
- Microsoft Access 2000 Standard Edition
| kberrmsg kbbug kbpending KB208331 |
Community Feedback System
Very often, it takes hours to solve a problem. Very often, you've looked high
and low, and have tried a lot of solutions. When you finally found it, chances
are, it was because someone else helped you. Here's your chance to give back.
Use our community feedback tool to let others know what worked for you and what
didn't.
Please also understand that the community feedback system is not warranted to be
correct, it's simply a system that we've built to let people try and help each
other. If something in a feedback response doesn't make sense to you, or you're
not comfortable making changes that the feedback talks about (like registry
edits), please consult a professional.
Thank you for using kbAlertz.com Feedback System.
-- Scott Cate