By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,387 Members | 1,743 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,387 IT Pros & Developers. It's quick & easy.

Report Detail_Format Event

P: n/a
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
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

Fred Zuckerman

Aug 30 '08 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.