Automatically Changing Background Color in a Form Text Box.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In my form I have a text box called "outcome" that I want that have the color change to light yellow if the "date" box has an entry. If the outcome then has an entry then I want to background to change back to white. How do I do that?
 
If you have Access 2000 or newer, open the form in design mode, right click
the textbox, and choose Conditional Formatting.

--
Wayne Morgan
Microsoft Access MVP


David Banghart said:
In my form I have a text box called "outcome" that I want that have the
color change to light yellow if the "date" box has an entry. If the outcome
then has an entry then I want to background to change back to white. How
do I do that?
 
I have Access 9

----- Wayne Morgan wrote: ----

If you have Access 2000 or newer, open the form in design mode, right clic
the textbox, and choose Conditional Formatting

--
Wayne Morga
Microsoft Access MV


David Banghart said:
In my form I have a text box called "outcome" that I want that have th
color change to light yellow if the "date" box has an entry. If the outcom
then has an entry then I want to background to change back to white. Ho
do I do that
 
In that case, you can do the conditional formatting in the AfterUpdate event
of the control and in the Current event of the form. You will need to do it
in both places.

Example:
Select Case Me.txtMyTextbox
Case < 10
Me.txtMyTextbox.BackColor = 16777215
Case < 20
Me.txtMyTextbox.BackColor = 255
Case Else
Me.txtMyTextbox.BackColor = 8421440
End Select

You can get the numbers for the colors by going to the BackColor item on the
Format tab of the control's Properties sheet and clicking the ... button.
Select the color you want and see what number gets placed into the box.
 
Back
Top