D
Dominic Vella
Hi
I'm developing code to build Matrix's and is already working, however I'd
like to include some conditional formatting to highlight Low, Medium, High,
Critical issues.
I've added a function which updates a Control (eg. text or combo box) with
Conditional Formatting, but it doesn't seem to be working properly.
Here is an example of 'similar' code I've written.
----------------------------------------------------------------------------
With Me.cboTest.FormatConditions
.Delete
.Add acFieldValue, acBetween, 7, 12
' The real code derives Add arguments from
' recordsets, so there may be variances
' on expression1 and expression2
.Add acFieldValue, acBetween, 13, 18
.Add acFieldValue, acGreaterThanOrEqual, 19
End With
Me.cboTest.BackColor = 255 ' Red
Me.cboTest.FormatConditions(0).BackColor = 65535 'Yellow
Me.cboTest.FormatConditions(1).BackColor = 16711680 'Blue
Me.cboTest.FormatConditions(2).BackColor = 65280 'Green
----------------------------------------------------------------------------
For some reason, the conditional formatting
1 ends up Red
2 to 7 ends up Yellow (Condition 0)
8 to 9 ends up Green (Condition 2)
10 to 11 ends up Red
12 to 25 ends up Yellow (Condition 0)
Can someone explain what's happening? Is it in some alphabetical testing
mode instead of Numerical testing? Is there a way to switch testing modes
from Numeric to Alphabetical?
I'm developing code to build Matrix's and is already working, however I'd
like to include some conditional formatting to highlight Low, Medium, High,
Critical issues.
I've added a function which updates a Control (eg. text or combo box) with
Conditional Formatting, but it doesn't seem to be working properly.
Here is an example of 'similar' code I've written.
----------------------------------------------------------------------------
With Me.cboTest.FormatConditions
.Delete
.Add acFieldValue, acBetween, 7, 12
' The real code derives Add arguments from
' recordsets, so there may be variances
' on expression1 and expression2
.Add acFieldValue, acBetween, 13, 18
.Add acFieldValue, acGreaterThanOrEqual, 19
End With
Me.cboTest.BackColor = 255 ' Red
Me.cboTest.FormatConditions(0).BackColor = 65535 'Yellow
Me.cboTest.FormatConditions(1).BackColor = 16711680 'Blue
Me.cboTest.FormatConditions(2).BackColor = 65280 'Green
----------------------------------------------------------------------------
For some reason, the conditional formatting
1 ends up Red
2 to 7 ends up Yellow (Condition 0)
8 to 9 ends up Green (Condition 2)
10 to 11 ends up Red
12 to 25 ends up Yellow (Condition 0)
Can someone explain what's happening? Is it in some alphabetical testing
mode instead of Numerical testing? Is there a way to switch testing modes
from Numeric to Alphabetical?