Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Highlighting Condition 1

Status
Not open for further replies.

EBox

Programmer
Dec 5, 2001
70
US
Hello-

In a detail section of a report, I would like to highlight a row if a text field named [Description] matches 10 specific values.

I have created a text box named "Highlight" which has a default BackColor set to 0, but I imagine could be triggered by code to set to yellow if it met the criteria above.

Can anyone help me put together the code that would satisfy this?

Many thanks,
EBox
 
What are the values? Do you need it to match all 10 values or any combination of the values?

You could do a Case statement let me know and I will help you set it up.

Bill
 
All 10. Say, for example the conditions were "A", "B", "C", etc. How would I set up the Case statement?

Thanks,
EBox
 
Well then we could probably just do an IF statement. I dont recall how many conditions you can have but try this..

If Me!Description = "A" And Me!Description = "B" And Me!Description = "C" And Me!Description = "D" And Me!Description = "E" And Me!Description = "F" And Me!Description = "G" And Me!Description = "H" And Me!Description = "I" And Me!Description = "J" Then
Me!Highlight.BackColor = YourColor
Else
Me!Highlight.BackColor = OriginalColor
End If

Bill
 
Bill-

Too many conditions, but I ended up making it into a series of If and ElseIf statements, which worked. Thanks for giving me the push that I needed!

EBox
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top