ACC: How to Use the Circle Method on a Report

Last reviewed: August 29, 1997
Article ID: Q116501
The information in this article applies to:
  • Microsoft Access version 2.0, 7.0, 97

SUMMARY

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

This article describes 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.

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


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: August 29, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.