I'm trying to create a report where each line has conditional formatting dependant on the contents of a field.
The standard Access conditional formatting system works OK but I want more control; borders, row height etc.
I can't seem to get this working in vba. Here's the code I used for a table with fields named 'Species' and 'AnimalType':
Code:
Private Sub Report_Load()
If Me.AnimalType = "Fish" Then
Me.Species.BorderWidth = 5
Me.Species.BorderColor = RGB(0, 255, 255)
ElseIf Me.AnimalType = "Mammal" Then
Me.Species.BorderWidth = 2
Me.Species.BackStyle = 0
Me.Species.FontSize = 12
Me.Species.ForeColor = RGB(255, 0, 0)
End If
End Sub
Every line is formatted as a Mammal. How can I get each line formatted differently according to the AnimalType field?