Adding transparent and color backgrounds to IIf with 4 conditions

Correenie

Registered User.
Local time
Today, 08:40
Joined
Feb 28, 2007
Messages
13
I asked this question improperly yesterday. I know color can be applied in "Conditional Formatting," but I need the field to be transparent if two of the yes/no fields are No.

Here is where I need to add the color:
=IIf([Toured]=True,"GT",IIf([Not Qualified]=True,"NQ",IIf([No Show]=True,"NS",IIf([No Tour]=True,"NT",Null))))

I need to make "NQ" appear on top of a light-orange background if true, and "NS" appear on top of a light-blue background if true. If neither are true, then the field needs to be transparent. (If impossible for a color background, then the text to appear these colors instead).

How is this done?

Thanks,

Correenie
 
How about do it in code instead of an IIF statement?
 
In the AfterUpdate event of the text box that has this control source, put this:
Code:
Select Case Me.YourTextBoxNameHere
   Case "NQ"
      Me.YourTextBoxNameHere.BackColor = 5672935
      Me.YourTextBoxNameHere.BackStyle = 1
   Case "NS"
      Me.YourTextBoxNameHere.BackColor = 16777088
      Me.YourTextBoxNameHere.BackStyle = 1
   Case Else
      Me.YourTextBoxNameHere.BackStyle = 0
End Select
 

Users who are viewing this thread

Back
Top Bottom