In a continuous form I am trying to change the ForeColor of [aAudit_d] depending on the values of [aAudit_d] (a date) and [IsPlan] (0 or 1).
My Form_Load event contains the following:
However the ForeColor of all records is Orange, independent of the values of [aAudit_d] and [IsPlan]. What as I doing wrong?
My Form_Load event contains the following:
Code:
Me![aAudit_d].FormatConditions.Delete
Set objFrc = Me![aAudit_d].FormatConditions.Add(acExpression, , Me![IsPlan] = 0)
Set objFrc = Me![aAudit_d].FormatConditions.Add(acExpression, , Me![IsPlan] = 1 And Me![aAudit_d] >= Now())
Set objFrc = Me![aAudit_d].FormatConditions.Add(acExpression, , Me![IsPlan] = 1 And Me![aAudit_d] < Now())
With Me![aAudit_d].FormatConditions(0)
.FontBold = False
.ForeColor = RGB(255, 255, 255) 'has been carried out; black
End With
With Me![aAudit_d].FormatConditions(1)
.FontBold = False
.ForeColor = RGB(255, 165, 0) 'planned, but in the future; orange
End With
With Me![aAudit_d].FormatConditions(2)
.FontBold = True
.ForeColor = RGB(255, 0, 0) 'planned in the past but not carried out; red
End With
However the ForeColor of all records is Orange, independent of the values of [aAudit_d] and [IsPlan]. What as I doing wrong?