Changing the background color of a control

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top