If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Changing the background color of a control
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 |
#2
|
|||
|
|||
Changing the background color of a control
Look into Conditional Formatting.
-- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "Abay" wrote in message ... 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 |
#3
|
|||
|
|||
Changing the background color of a control
Many thanks for your reply Doug .. will try out conditional formatting ..
Abay "Douglas J. Steele" wrote in message ... Look into Conditional Formatting. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "Abay" wrote in message ... 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 |
Thread Tools | |
Display Modes | |
|
|