Hi All,
I have a report with an accumulating value control. I use the Detail_Format
event to periodically change the backcolor of the control. The control
(Me.Tot) prints green except for the records where it reaches a multiple of
300. In the Open event I set the variable Milestone to an initial value of
300. On the initial records, Me.Tot prints with backcolor of green. When
Me.Tot reaches 300 I change the backcolor to red and reset Milestone to 600,
etc. So the records print green except for the records that reach a multiple
of 300.
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me.Tot >= Milestone Then
Me.Tot.BackColor = vbRed
Milestone = Milestone + 300
Else
Me.Tot.BackColor = vbGreen
End If
End Sub
This report has many records so I use columns (down then across). It usually
works fine, but I have found one odd-ball scenario that breaks. On the rare
occasions when the record that reaches a multiple of 300 is also at the top
of a new column, the control prints green, NOT red. However, the
detail_format event IS firing, because the variable Milestone is changing
from 300 to 600.
I hope this explanation makes sense and somebody can respond. I think it
might have something to do with "retreat events" but I don't understand that
concept.
TIA,
Fred Zuckerman