I'm trying to put a conditional format on a report field using vba in access 97 with little success.
Basically there are two date fields [Date Forecast] and [Date Actual].
If [Date Actual] exceeds [Date Forecast]then the background colour of the field needs to turn red and the text white.
The code I thought would work ...
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If [Date Actual] > [Date Forecast] Then
BackColor = 255
ForeColor = 16777215
End If
End Sub
All this gives me is a 'variable not defined' error
Anyone any ideas?[/FONT]
Basically there are two date fields [Date Forecast] and [Date Actual].
If [Date Actual] exceeds [Date Forecast]then the background colour of the field needs to turn red and the text white.
The code I thought would work ...
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If [Date Actual] > [Date Forecast] Then
BackColor = 255
ForeColor = 16777215
End If
End Sub
All this gives me is a 'variable not defined' error
Anyone any ideas?[/FONT]