Report Background Colour

  • Thread starter Thread starter Bryan
  • Start date Start date
B

Bryan

Hi, Does anyone know how to write a line of code to change
the background colour per line of infomation by 2
different text boxes in Report. I have a report with 10
different Feild text boxes. The ones I wanted to change
colour are by Drawing No and Sht No. When the next Line of
infomation is a different Drawing No and
sht No I want the whole line of information to change to a
different(Light Blue)Colour and then the next Drawing No
And Sht No Change to a (light Yellow) and keep alternating
I,m just new at access and dont know how to write code.
Thanks Bryan
 
I think what you want to do is alternate between light blue and light yellow
in the detail section of the report.

Change the back style for each control in the detail section to Transparent.

Put this code in the On Format event of the detail section:


Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Static intTimesCalled As Integer
If intTimesCalled Mod 2 = 0 Then
Me.Detail.BackColor = 11599871
Else
Me.Detail.BackColor = 16764573

End If
intTimesCalled = intTimesCalled + 1
End Sub
 
Back
Top