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
|
|||
|
|||
Text colour on a form
I have an unbound text box, with a simple Iif statement to give a "Yes" or
"No". I would like this to stand out by having the text green for "yes" and red for "no" - or if this is not possible can I change the background colour of the text box as above. How is the best way to achieve this. Bob |
#2
|
|||
|
|||
Text colour on a form
On Thu, 29 Apr 2004 18:47:23 GMT, Box 666 wrote:
I have an unbound text box, with a simple Iif statement to give a "Yes" or "No". I would like this to stand out by having the text green for "yes" and red for "no" - or if this is not possible can I change the background colour of the text box as above. How is the best way to achieve this. Bob Depends upon which version of Access you have. In Access 2000 or newer: Click on the control. Then format + Conditional formatting Set the Condition1 Drop-down to Field Value is Then select Equal to in the box alongside. In the box alongside write "Yes" Select the Font color (and/or the BackColor) for when the condition is met as well as when it is not met (the Default setting). For Access 97, using single view form, this can also be done, but you must use code. Post back if that's what you need. -- Fred Please only reply to this newsgroup. I do not reply to personal email. |
#3
|
|||
|
|||
Text colour on a form
Using 2000, but thank you for the offer.
Bob "fredg" wrote in message ... On Thu, 29 Apr 2004 18:47:23 GMT, Box 666 wrote: I have an unbound text box, with a simple Iif statement to give a "Yes" or "No". I would like this to stand out by having the text green for "yes" and red for "no" - or if this is not possible can I change the background colour of the text box as above. How is the best way to achieve this. Bob Depends upon which version of Access you have. In Access 2000 or newer: Click on the control. Then format + Conditional formatting Set the Condition1 Drop-down to Field Value is Then select Equal to in the box alongside. In the box alongside write "Yes" Select the Font color (and/or the BackColor) for when the condition is met as well as when it is not met (the Default setting). For Access 97, using single view form, this can also be done, but you must use code. Post back if that's what you need. -- Fred Please only reply to this newsgroup. I do not reply to personal email. |
#4
|
|||
|
|||
Text colour on a form
In the Change Event of the Text Box write the following code:
Private Sub txtAnswer_Change() If txtAnswer.Text = "Yes" Then txtAnswer.BackColor = vbGreen ElseIf txtAnswer.Text = "No" Then txtAnswer.BackColor = vbRed Else txtAnswer.BackColor = vbWhite End If End Sub You might need to replace txtAnswer with the name of your text box. -- Marin Kostov Microsoft Office XP Master Instructor |
Thread Tools | |
Display Modes | |
|
|