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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA - if then else to set bgcolor

Status
Not open for further replies.

pmsbony

IS-IT--Management
May 17, 2001
36
0
0
GB
I have a form that displays a list of records from a table.

Based on the entry in one of the fields I want to set the bgcolor of that specific field to either red or green.

the code i am using is:

If Call_Status = "open" Then
Call_Status.BackColor = vbRed
Else: Call_Status.BackColor = vbGreen
End If

this does not seem to work. Any ideas what I am doing wrong. Also at what point should the code run? when the form loads or opens, before update on that specific field or another time. All help will be rewarded with good vibes sent in your general direction

cheers

Pete
 
Have you tried conditional format ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
worked like a charm - ta very much

the vibes are heading your way
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top