How to change text box backcolour ...

  • Thread starter Thread starter NP
  • Start date Start date
N

NP

I have a form (continous) listing all records in the table.



The form contains two fields ... Field 1 in which a Y or N can be entered
and field 2 the same (enter Y or N).



If the value in field 1 is Y and the value in field 2 is N then I would like
the backcolour of field 2 to appear in green.



Is this possible and if so how can I implement?



Many thanks,



CB.
 
If this is Access 2000 or later, you can use conditional formatting.

1. Open your form in design view.

2. Select the text box to be formatted.

3. Choose Conditional Formatting from the Format menu.

4. Enter an expression, such as:
([Field 1] = 'Y') AND ([Field 2] = 'N')
and use the bucket to select the BackColor you want.

Note that if Field 1 and Field 2 are Yes/No fields, you will need:
([Field 1] = True) AND ([Field 2] = False)
 
That's great. Sorted.

Many thanks.


Allen Browne said:
If this is Access 2000 or later, you can use conditional formatting.

1. Open your form in design view.

2. Select the text box to be formatted.

3. Choose Conditional Formatting from the Format menu.

4. Enter an expression, such as:
([Field 1] = 'Y') AND ([Field 2] = 'N')
and use the bucket to select the BackColor you want.

Note that if Field 1 and Field 2 are Yes/No fields, you will need:
([Field 1] = True) AND ([Field 2] = False)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

NP said:
I have a form (continous) listing all records in the table.

The form contains two fields ... Field 1 in which a Y or N can be entered
and field 2 the same (enter Y or N).

If the value in field 1 is Y and the value in field 2 is N then I would like
the backcolour of field 2 to appear in green.
 
Back
Top