Hello!
I am trying to apply conditional formatting to several subreports within a main report (Charlie) with code - because I have four conditions.
When the value of txt_SafetyFundi ngNumber is
1-5, red fill with white font;
6-9, yellow fill with black font;
10-14 blue fill with white font; and
15-20, green fill with white font.
The following is my attempt to apply a red fill with white font when the value of the textbox is <=5.
I've attached the zipped db to take a peek. This is the last piece of a very long and painful process for a newbie! Every time I complete one piece, I hit another wall........I guess this is trial-by-fire?
Thanks so much for any advice anyone cares to give!
:)
I am trying to apply conditional formatting to several subreports within a main report (Charlie) with code - because I have four conditions.
When the value of txt_SafetyFundi ngNumber is
1-5, red fill with white font;
6-9, yellow fill with black font;
10-14 blue fill with white font; and
15-20, green fill with white font.
The following is my attempt to apply a red fill with white font when the value of the textbox is <=5.
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
' Set color coding of field based on value
Dim intSafetyFundNum As Integer
If Not IsNull(Me.txt_SafetyFundingNumber.Value) Then
intSafetyFundNum = Me.txt_SafetyFundingNumber.Value
Else
Exit Sub
End If
If intSafetyFundNum <= 5 Then
Me.txt_SafetyFundingNumber.Report.FillColor = 3
Me.txt_SafetyFundingNumber.Report.ForeColor = 1
End If
End Sub
Thanks so much for any advice anyone cares to give!
:)
Comment