ACC97: "Division by Zero" Error Using Publish To The Web WizardLast reviewed: January 6, 1998Article ID: Q178886 |
The information in this article applies to:
SYMPTOMSModerate: 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. CAUSEThis behavior occurs if the following conditions are true:
RESOLUTIONThe 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:
How to Use the ScaleMode PropertyThe 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:
1. In Microsoft Access 97, open a new blank database. 2. In the Database window, click the Reports tab. 3. Click New to create a report in Design view. Do not select a table or query to base the report on. Click OK. 4. Using the right mouse button (right-click), click inside the Details section of the report and click Build Event on the shortcut menu. 5. In the Choose Builder dialog box, click Code Builder, and then click OK. 6. 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 7. Close the Module window. 8. 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 9. Close the Module window and save the report as MyReport. 10. 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 INFORMATION
Steps to Reproduce Behavior
REFERENCESFor 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
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |