photoguy53
Technical User
Have been searching a while on this and other forums for a solution to this problem:
I have a report that shows 79 rows of ranked data, only it all appears in the GroupFooter section. (Got rid of the Detail Section, for various reasons). I've been exploring forums to try and find a way and/or code to have it shade the rows in groups of 10. In other words, the first 10 rows on the report would be for example yellow, the next 10 light blue, the 3rd set of ten light green, and then repeat or just the default white. I've seen some posts for alternating the color of rows, and even changing the color every 'x' rows, but all have been done in the DETAIL section. I've trying copying the code and playing with it, but can't seem to get it to work in the GroupFooter section.
Any ideas would be greatly appreciated! If this isn't an adequate description of what I'm looking to do, just ask me more! By the way I'm using Access 2003. I've tried the following code in both the OnFormat and OnPrint Expressions to no avail. Maybe someone could take a look to see if I'm doing something wrong here?
Private Sub GroupFooter1_Format(Cancel As Integer, FormatCount As Integer)
Lines
End Sub
Private Sub Lines()
Const cGray = &HF0F0F0
Const cWhite = &HFFFFFF
Dim Color As Long
Dim CTL As Control
Dim i As Integer
Static MyCount As Integer
MyCount = MyCount + 1
Select Case MyCount
Case 1 To 5: Color = cGray
Case 6 To 10: Color = cWhite
Case Else: Color = cGray: MyCount = 1
End Select
For i = 0 To Me.Count - 1
Set CTL = Me(i)
If CTL.Section = 8 Then CTL.BackColor = Color
Next
End Sub
Thanks again!
I have a report that shows 79 rows of ranked data, only it all appears in the GroupFooter section. (Got rid of the Detail Section, for various reasons). I've been exploring forums to try and find a way and/or code to have it shade the rows in groups of 10. In other words, the first 10 rows on the report would be for example yellow, the next 10 light blue, the 3rd set of ten light green, and then repeat or just the default white. I've seen some posts for alternating the color of rows, and even changing the color every 'x' rows, but all have been done in the DETAIL section. I've trying copying the code and playing with it, but can't seem to get it to work in the GroupFooter section.
Any ideas would be greatly appreciated! If this isn't an adequate description of what I'm looking to do, just ask me more! By the way I'm using Access 2003. I've tried the following code in both the OnFormat and OnPrint Expressions to no avail. Maybe someone could take a look to see if I'm doing something wrong here?
Private Sub GroupFooter1_Format(Cancel As Integer, FormatCount As Integer)
Lines
End Sub
Private Sub Lines()
Const cGray = &HF0F0F0
Const cWhite = &HFFFFFF
Dim Color As Long
Dim CTL As Control
Dim i As Integer
Static MyCount As Integer
MyCount = MyCount + 1
Select Case MyCount
Case 1 To 5: Color = cGray
Case 6 To 10: Color = cWhite
Case Else: Color = cGray: MyCount = 1
End Select
For i = 0 To Me.Count - 1
Set CTL = Me(i)
If CTL.Section = 8 Then CTL.BackColor = Color
Next
End Sub
Thanks again!