P
PeterM
I have a continuous form which contains a date field called Call_Back_Date.
I need to be able to conditionally set the forecolor of that field for each
record depending on it's value.
Below is the code I'm using with no success. I suspect it's the
acExpression value of "[call_back_date] = date", I'm comparing the
call_back_date value to today's date. I've tried formatting the date, using
now() and none of the conditions are being triggered...can anyone please tell
me why? What am I doing wrong?
Public objFrc As FormatCondition
Private sub Set_Conditions()
Me.Call_Back_Date.FormatConditions.Delete
Set objFrc = Me.Call_Back_Date.FormatConditions.Add(acExpression, ,
"[call_back_date] = date")
Set objFrc = Me.Call_Back_Date.FormatConditions.Add(acExpression, ,
"[call_back_date] < date")
Set objFrc = Me.Call_Back_Date.FormatConditions.Add(acExpression, ,
"[call_back_date] > date")
'set the default value
With Me.Call_Back_Date
.ForeColor = vbVlue
End With
With Me.Call_Back_Date.FormatConditions(0)
.ForeColor = vbRed
End With
With Me.Call_Back_Date.FormatConditions(1)
.ForeColor = vbBlack
End With
'req call/onsite mtg
With Me.Call_Back_Date.FormatConditions(2)
.ForeColor = vbGreen
End With
End Sub
I need to be able to conditionally set the forecolor of that field for each
record depending on it's value.
Below is the code I'm using with no success. I suspect it's the
acExpression value of "[call_back_date] = date", I'm comparing the
call_back_date value to today's date. I've tried formatting the date, using
now() and none of the conditions are being triggered...can anyone please tell
me why? What am I doing wrong?
Public objFrc As FormatCondition
Private sub Set_Conditions()
Me.Call_Back_Date.FormatConditions.Delete
Set objFrc = Me.Call_Back_Date.FormatConditions.Add(acExpression, ,
"[call_back_date] = date")
Set objFrc = Me.Call_Back_Date.FormatConditions.Add(acExpression, ,
"[call_back_date] < date")
Set objFrc = Me.Call_Back_Date.FormatConditions.Add(acExpression, ,
"[call_back_date] > date")
'set the default value
With Me.Call_Back_Date
.ForeColor = vbVlue
End With
With Me.Call_Back_Date.FormatConditions(0)
.ForeColor = vbRed
End With
With Me.Call_Back_Date.FormatConditions(1)
.ForeColor = vbBlack
End With
'req call/onsite mtg
With Me.Call_Back_Date.FormatConditions(2)
.ForeColor = vbGreen
End With
End Sub