N
NevilleT
I am trying to get conditional formatting to work using VBA. The formatting
is on a subform and I want to change the colour of a text box (txtTaskName)
if a checkbox called chkSummary is true.
When I open the form, there is no format change. If I move my mouse over
the column, as I move over each record it turns blue even if the condition is
true or not.
Dim objFormCon As FormatCondition
Dim lngBlue As Long
lngBlue = RGB(139, 219, 233)
'Remove existing format conditions
Me!txtTaskName.FormatConditions.Delete
Set objFormCon = Me![txtTaskName].FormatConditions.Add(acExpression, _
, Me.chkSummary = True)
With Me!txtTaskName.FormatConditions(0)
.ForeColor = lngBlue
End With
is on a subform and I want to change the colour of a text box (txtTaskName)
if a checkbox called chkSummary is true.
When I open the form, there is no format change. If I move my mouse over
the column, as I move over each record it turns blue even if the condition is
true or not.
Dim objFormCon As FormatCondition
Dim lngBlue As Long
lngBlue = RGB(139, 219, 233)
'Remove existing format conditions
Me!txtTaskName.FormatConditions.Delete
Set objFormCon = Me![txtTaskName].FormatConditions.Add(acExpression, _
, Me.chkSummary = True)
With Me!txtTaskName.FormatConditions(0)
.ForeColor = lngBlue
End With