Brain Fade

  • Thread starter Thread starter Smokin PT
  • Start date Start date
S

Smokin PT

Stupid question for ya.
I think I have in the past been able to format text for a specific record on
a form to be either red or black based on the value of another field.
Example: if the value of "fielda" is less than 2 then format the text in red
on "fieldb" otherwise do nothing. For the life of me I can't remember how I
can do this. I think I need to use a standard iif statement but I can't seem
to get it to work. Any ideas?

Ron
 
If using Office 2000 or higher you can use conditional
formatting. You get up to 3 conditions.
On the menu bar go to
format
Conditional Formatting

Jim
 
Thank you very much. It works great! although not what I wanted. I need to
explain myself better. I am only displaying data on a continous form. I
wanted to highlight certain records on the form where the value of one field
within that record is less than 2. I do not want to change the appearance of
the other records. I was hoping to change the text color to red or even the
background to a different color. Just some way to highlight the record under
the above condition.

Ron
 
Thanks Chris, I wish I was using anything but Access 97. At home I have the
latest and greatest but my company is to cheap to invest in better software.
arrrgh
 
Here is one solution:
Let's have your textboxes named txtFirst and txtSecond

Add the following code in txtFirst Xhange Event Procedure:

(Hit F4, Event Tab, On Change, click ... and choose Code Builder)

Private Sub txtFirst_Change()
If Val(txtFirst.Text) < 2 Then
txtSecond.ForeColor = vbRed
Else
txtSecond.ForeColor = vbBlack
End If
End Sub
 
Back
Top