"WU10" <cliff_wooten@hotmail.comwrote in message
news:1172828857.782836.51900@j27g2000cwj.googlegro ups.com...
Quote:
>I have built a simple database to track the mechanical condition of
offshore equipment. We established a system of ranking for issues
that arise and used conditional formatting of the cell's background to
make these issues visible. White cell (default) indicates "No Issue",
Green "Low", Yellow "Medium" and Red "High". This is currently woking
fine.
>
Recently our corporate gurus have now come up with a 4th color, Amber
"Significant" which sits between the Yellow and Red. Since one has
only 3 standard conditions available we determined that we need to
write a macro in order to use this 4th color.
>
I do not have a clue how to even start building this macro. HELP!!
>
You need to put some code in the form's After Update event, something like
(untested):
If Me.txtMyTextBox = "No Issue" Then
Me.txtMyTextBox.BackColor = xxx
ElseIf Me.txtMyTextBox = "Low" Then
Me.txtMyTextBox.BackColor = yyy
ElseIf Me.txtMyTextBox = "Medium" Then
Me.txtMyTextBox.BackColor = zzz
Else
Me.txtMyTextBox.BackColor = nnn
End If
This assumes that your "cell" is a text box that is bound to the field that
contains the "Low", "Medium" etc data, that the text box name is
"txtMyTextBox" and that xxx, yyy, zzz and nnn are the VBA numbers for the
colours you require. You'd also need to call this code from the form's
Current event.
HTH - Keith.
www.keithwilby.com