ACC2000: How to Use the Circle Method on a Report

ID: q210365


The information in this article applies to:

This article applies only to a Microsoft Access database (.mdb).

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.


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:


  3. 
    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 
  4. Create a new report named TestReport. The report can be bound or unbound.


  5. Set the OnPrint property of the detail section of the report to the following expression:


  6. 
        =PIE([Reports]![TestReport]) 
  7. Set the Height property of the detail section to 2.5 inches.


  8. Preview the report.



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.

Additional query words:


Keywords          : kbprg kbdta AccCon RptEvent 
Version           : WINDOWS:2000
Platform          : WINDOWS 
Issue type        : kbhowto 

Last Reviewed: May 21, 1999