Conditional Formatting with more then 3 conditions
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?
Ο χρήστης "Wayne Morgan" *γγραψε:
Yes, in the Format event of the section of the report that the field is
reported in, you could set the formatting of the control for that field. A
Select Case statement may be the easiest.
Example:
Select Case Me.txtMyTextbox
Case "AB"
Me.txtMyTextbox.ForeColor = 8454143
Case 'etc
Case Else
Me.txtMyTextbox.ForeColor = 0
End Select
--
Wayne Morgan
MS Access MVP
"Tim" wrote in message
...
ACCESS 2000
There is a field in my database that requires highlighting; however, I
have
a total of 15 cases that requires, obviously I can't set that up with the
default C.F.
Is there a way to set up a VBA code that would allow me to set up the 15
conditions?
|