conditional formatting based on count

  • Thread starter Thread starter Larry B
  • Start date Start date
L

Larry B

I have a report that provides the detail of medical payments billed. I have a
count field on the report to tell me the number of payments sent and another
field to show how many can still be billed out of the predetermined number of
24 (the max number of payments we can bill)
Each payment is on seperate row in the group on the report.
I would like to highlight the rows that exceed the 24 max payment limit. For
example, if the patient only has 20 payments billed, then nothing happens,
but on the 25th payment, I need it highlighted. How can I do this?
 
Larry B said:
I have a report that provides the detail of medical payments billed. I have a
count field on the report to tell me the number of payments sent and another
field to show how many can still be billed out of the predetermined number of
24 (the max number of payments we can bill)
Each payment is on seperate row in the group on the report.
I would like to highlight the rows that exceed the 24 max payment limit. For
example, if the patient only has 20 payments billed, then nothing happens,
but on the 25th payment, I need it highlighted. How can I do this?


Add a (hidden?) text box (named txtPayNum) to the detail
section. Set its control source to =1 and RunningSum
property to Over Group.

Then add some code to the detail section's Format event:

If Me.txtPayNum > 24 Then
Me.payment..BackColor = vbYellow
Else
Me.payment..BackColor = vbWhite
End If
 
Back
Top