J
John Taylor
Using A2003 and W2k,
Basically, I want to draw a circle on a report and colour the fillcolor of
the circle depending upon the value in a field called "[Risk]".
I've found some good stuff around but all of it (that I have found) is
basically a "pie chart" with one slice coloured but I can't find any way to
"conditionally" format the back colour.
I've tried to modify the code and, although the circle is perfect, there is
no back fill I just can't get it to work.
The code I'm using to draw the circle - courtesy of Microsoft Developer
Network is this:-
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Const conPI = 3.14159265359
Dim sngHCtr As Single
Dim sngVCtr As Single
Dim sngRadius As Single
sngHCtr = Me.ScaleWidth / 1.157 ' Horizontal center.
sngVCtr = Me.ScaleHeight / 2 ' Vertical center.
sngRadius = Me.ScaleHeight / 10 ' Circle radius.
Me.Circle (sngHCtr, sngVCtr), sngRadius ' Draw circle.
Me.FillColor = RGB(255, 0, 0) ' Color the circle.
Me.FillStyle = 0 ' Fill the circle
End Sub
That is the first issue (drawing and colouring the circle) - the next is to
conditionally format the back colour of the circle based on the field
"[Risk]" which is simply either 1, 2 or 3 (you probably guessed it - traffic
lights) I really have no idea on how to conditioanally format the circle -
my trial with "iif" and "It, Then, Else" statements have been less than
successfull.
Any help wil be much appreciated - thanks in advance.
John Taylor
Basically, I want to draw a circle on a report and colour the fillcolor of
the circle depending upon the value in a field called "[Risk]".
I've found some good stuff around but all of it (that I have found) is
basically a "pie chart" with one slice coloured but I can't find any way to
"conditionally" format the back colour.
I've tried to modify the code and, although the circle is perfect, there is
no back fill I just can't get it to work.
The code I'm using to draw the circle - courtesy of Microsoft Developer
Network is this:-
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Const conPI = 3.14159265359
Dim sngHCtr As Single
Dim sngVCtr As Single
Dim sngRadius As Single
sngHCtr = Me.ScaleWidth / 1.157 ' Horizontal center.
sngVCtr = Me.ScaleHeight / 2 ' Vertical center.
sngRadius = Me.ScaleHeight / 10 ' Circle radius.
Me.Circle (sngHCtr, sngVCtr), sngRadius ' Draw circle.
Me.FillColor = RGB(255, 0, 0) ' Color the circle.
Me.FillStyle = 0 ' Fill the circle
End Sub
That is the first issue (drawing and colouring the circle) - the next is to
conditionally format the back colour of the circle based on the field
"[Risk]" which is simply either 1, 2 or 3 (you probably guessed it - traffic
lights) I really have no idea on how to conditioanally format the circle -
my trial with "iif" and "It, Then, Else" statements have been less than
successfull.
Any help wil be much appreciated - thanks in advance.
John Taylor