ACC97: "Division by Zero" Error Using Publish To The Web Wizard
ID: Q178886
|
The information in this article applies to:
SYMPTOMS
Moderate: Requires basic macro, coding, and interoperability skills.
After you set the ScaleMode property in a report to 5 or to 7 and try to
publish the report as HTML by using the "Publish to the Web Wizard," the
wizard may fail, and you may receive the following error message:
Division by Zero.
CAUSE
This behavior occurs if the following conditions are true:
- The ScaleMode property of any of the following sections is set to 5 or
to 7:
- Report Header or Footer
- Page Header or Footer
- Group Header or Footer
- The following types of controls are in the sections:
- Labels
- Text boxes
- Combo boxes
- List boxes
- Option buttons
- Option groups
- Check boxes
- Bound object Frames
- Subreports
RESOLUTION
The ScaleMode property, in conjunction with the ScaleHeight, ScaleWidth,
ScaleLeft, and ScaleTop properties are generally used to create custom
coordinate systems for purposes of drawing or changing the size of objects
on a report or form.
If it is necessary to use inches or centimeters as a scale, you can do so
by setting the ScaleMode property to 1 (Twips), and then using the
following conversions to arrive at an equivalent setting in inches or
centimeters:
- 1440 Twips equals one logical inch
- 567 Twips equals one logical centimeter
How to Use the ScaleMode Property
The following steps illustrate how you can draw two circles that appear as
though they are the same size even though a different ScaleMode property is
used with each one:
- In Microsoft Access 97, open a new blank database.
- In the Database window, click the Reports tab.
- Click New to create a report in Design view. Do not select a table or
query to base the report on. Click OK.
- Using the right mouse button (right-click), click inside the Details
section of the report and click Build Event on the shortcut menu.
- In the Choose Builder dialog box, click Code Builder, and then click
OK.
- Type or paste the following event procedure in the Module window:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
' Set the ScaleMode property of the Details section to 5 (Inches)
Me.ScaleMode = 5
' Draw a circle in the Details section with a radius of .25
' Inches.
Circle (ScaleWidth / 2, ScaleHeight / 2), 0.25
End Sub
- Close the Module window.
- While in Design view of the report, right-click in the Page Footer
section. On the shortcut menu, click Build event and type or paste the
following procedure:
Private Sub PageFooter_Format(Cancel As Integer, FormatCount As _
Integer)
' Set the ScaleMode property of Page Footer section of the report
' to 1 (Twips)
Me.ScaleMode = 1
' Draw a circle in the Details section of the report with a
' radius 1 of .25 Inches by multiplying .25 by 1440 which will
' return the equivalent of .25 Inches
Circle (ScaleWidth / 2, ScaleHeight / 2), (0.25 * 1440)
End Sub
- Close the Module window and save the report as MyReport.
- Open the newly created report by selecting the Reports tab, and then
double-clicking MyReport.
While viewing the report, notice that the circumference of the two
circles are the same even though a different ScaleMode setting was
used to render each one.
MORE INFORMATIONSteps to Reproduce Behavior
- Repeat steps 1-5 in the "How to Use the ScaleMode Property" section.
- Type or paste the following event procedure in the Module window:
Private Sub Detail_Format(Cancel As Integer, FormatCount As _
Integer)
' Set the ScaleMode property of the Details section to 5 (Inches)
Me.ScaleMode = 5
End Sub
- Save changes and close the Module window.
- Add an unbound text box to the Details section of the report.
- Save the Report as MyTestReport and close it.
- On the File menu, click Save As HTML.
- When the "Publish to the Web Wizard" screen appears, click Next.
- Click to select the MyTestReport check box.
- Click the Finish button.
Note that you receive the error message mentioned in the "Symptoms
section."
REFERENCES
For more information about the ScaleMode property, search the Help Index
for "ScaleMode Property," or ask the Microsoft Access 97 Office Assistant.
Additional query words:
prb division error divide
Keywords : kberrmsg RptOthr WzProb
Version : WINDOWS:97
Platform : WINDOWS
Issue type : kbprb
|