Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

ACC2000: How to Use the Circle Method on a Report


View products that this article applies to.

This article was previously published under Q210365
This article applies only to a Microsoft Access database (.mdb).

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

↑ Back to the top


Summary

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

↑ Back to the top


More information

The following sample, user-defined function, PIE(), can be called from an event property in the detail section of a report. 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 detail section of the report to the following expression:
        =PIE([Reports]![TestReport])
    					
  5. Set the Height property of the detail section to 2.5 inches.
  6. Preview the report.

↑ Back to the top


References

For more information about the Circle method, in the Visual Basic Editor, click Microsoft Visual Basic Help on the Help menu, type Circle Method in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

↑ Back to the top


Keywords: KB210365, kbprogramming, kbofficeprog, kbhowto, kbdta

↑ Back to the top

Article Info
Article ID : 210365
Revision : 3
Created on : 10/11/2006
Published on : 10/11/2006
Exists online : False
Views : 346