Microsoft KB Archive/116501

= ACC: How to Use the Circle Method on a Report =

Article ID: 116501

Article Last Modified on 1/19/2007

-

APPLIES TO


 * Microsoft Access 2.0 Standard Edition
 * Microsoft Access 95 Standard Edition
 * Microsoft Access 97 Standard Edition

-



This article was previously published under Q116501



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



SUMMARY
This article shows you how to use the Circle method to create a filled-in "pie slice" on a report.

This article assumes that you are familiar with Visual Basic for Applications and with creating Microsoft Access applications using the programming tools provided with Microsoft Access. For more information about Visual Basic for Applications, please refer to your version of the "Building Applications with Microsoft Access" manual.

NOTE: Visual Basic for Applications is called Access Basic in Microsoft Access version 2.0. For more information about Access Basic, please refer to the "Building Applications" manual.



MORE INFORMATION
The following sample user-defined function, PIE, can be called from an event property on the report's detail section. The function uses the Circle method to create a filled-in "pie slice" on the report:  Start Microsoft Access and open any database.  Create a new module and enter the following code: Function PIE(Rpt as Report) Const PI = 3.14159265359 Const CStart = -.00000001 Const CEnd = -2 * PI / 6

Rpt.FillColor = RGB(255, 0, 0) Rpt.FillStyle = 0 Rpt.Circle (1500, 1500), 1500, RGB(0, 255, 0), Cstart, CEnd End Function  Create a new report named TestReport. The report can be bound or unbound.  Set the OnPrint property of the report's detail section to the following expression: =PIE([Reports]![TestReport])  Set the Height property for the detail section to 2.5 inches . Preview the report.</li></ol>

<div class="references_section">