Changing the background color of a control

  • Thread starter Thread starter Abay
  • Start date Start date
A

Abay

Hello ... I use the following code to change the background color of a
control when the value in another control (total) is > 0

If Dair_trans > 0 Then
Ddesc.BackStyle = 1
Ddesc.BackColor = vbRed
Else
Ddesc.BackStyle = 0

End If

When I click Ddesc and the value of total is > 0 the color changes on all
the lines (a multiline form) regardless of the value of the total control

Is there a way to change the colour of the control in question only if the
condition is met and for it to say colored .. ie the control on that line
only is changed.

Any help would be most appreciate.

Abay
 
Back
Top