ACC: Incorrect PrtMip Example in Help
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 that 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
- Open the sample database Northwind.mdb.
- Search for the "PrtMip property" using the Microsoft Access Help Index.
- 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.
- In Microsoft Access 7.0, type the following line in the Debug window,
and then press ENTER:
PrtMipCols("Catalog")
Note that you receive the error message.
- 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 : kberrmsg
Version : 7.0 97
Platform : WINDOWS
Issue type :