ACC: How to Use the Circle Method on a Report

ID: Q116501

The information in this article applies to:

SUMMARY

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

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:

1. Start Microsoft Access and open any database.

2. 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

3. Create a new report named TestReport. The report can be bound or
   unbound.

4. Set the OnPrint property of the report's detail section to the
   following expression:

      =PIE([Reports]![TestReport])

5. Set the Height property for the detail section to 2.5 inches.

6. Preview the report.

REFERENCES

For more information about the Circle method, search the Help Index for "Circle method," ask the Microsoft Access 97 Office Assistant.

You can find information, instructions, and examples in the Developer Solutions sample application (Solutions.mdb) included with Microsoft Access 97. For more information about "drawing circles on reports," open the Solutions.mdb database usually located in the Access\Samples folder. Select "Control what you print on reports." in the Select A Category Of Examples box, and then "Draw a circle around data to accentuate it." in the Select An Example box.

Additional query words:

Keywords          : kbprg RptEvent 
Version           : 2.0 7.0 97
Platform          : WINDOWS
Hardware          : x86
Issue type        : kbhowto

Last Reviewed: November 21, 1998