Why doesn't this work?....

G

Guest

I'm trying to alternately highlight rows in a report by the Date field. I'm
using the following code in the Group Header:

Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)
m_RowCount = Format([tblwodDate] + 1, "General Number")
If m_RowCount / 2 = CLng(m_RowCount / 2) Then
Me.Detail.BackColor = 16777215 'Change value to the color you
desire
Else
Me.Detail.BackColor = 15790320 'Change value to the color you
desire
End If
End Sub

The result I'm getting is that ALL of the records are highlighted, not
alternately by different dates.
I've also tried placing a non-visible text box in the detail section and
making "m_RowCount" equal the text box +1 (formatted as a General Number).
Still no luck.
Any suggestions?
 
D

Douglas J. Steele

What's the data type of m_RowCount? Assuming it's a Long Integer, m_RowCount
/ 2 will always equal CLng(m_RowCout / 2)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top