conditional formatting does not work, so i used code instead.
i have entered the following code in the OnFormatEvent of the Detail section:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Select Case Me.category
Case "A"
Me.client.BackColor = 12632256
Case "B"
Me.client.BackColor = 12632256
Case "C"
Me.client.BackColor = 12632256
Case Else
Me.client.BackColor = 16777215
End Select
Select Case Me.category
Case "dat"
Me.client.FontUnderline = yes
Case Else
Me.client.FontUnderline = no
End Select
End Sub
but i get the formatting only with the back color, not with the font
underline. have i done something wrong with the code?
Ο χÏήστης "Duane Hookom" ÎγγÏαψε:
The expression from the Conditional Formatting should evaluate to either
True/-1 or False/0. "Like" is generally used with wildcards to match one
value with part of another value. " and " is used to further filter a
condition. In your expression, one value can't equal "value1" AND equal
"value2". It might equal one OR the other.
I'm not sure that is what you want. I'm not sure if you can use "IN ( )" in
conditional formatting but you might be able to change your expression to:
=([another control box name] = "value1" OR [another control box name] =
"value2" OR [another control box name] = "value3")
--
Duane Hookom
Microsoft Access MVP
angie said:
there is a limit of 3 conditions so i have tried to use the following
expression to format my control box according to the value of another control
box:
iif([another control box name] like "value1" and "value2" and "value3";1;0)
but it does not work properly, i get the desired format only when the other
control box contains "value1".
i need your help!