Alter specific records in a continuous form

kuipers78

Registered User.
Local time
Today, 18:22
Joined
May 8, 2006
Messages
45
Hello,

I have created a continuous form with a query as record source. The field names of this query are being displayed in my form header, while the detail section of the form contains all records.
One of the fields ("Mark") contains a number from 1 to 10. I wanted to change the records who have a value from 1 to 5 to a red text color. So, I wrote this code:

Code:
If (me.Mark <= 5) then
me.Mark.ForeColor = 255  ' this is the code for red
End if

However, when the query contains at least one record who meets this condition, all records while be displayed in a red color. This is because of the continuous form I guess... :(

Is it possible that only the records with value 1 to 5 are being displayed in a red text color (within the same field in a continuous form)?

Any help on this would be greatly appreciated! :) Thanx!
 
Use conditional formatting instead. Select the text box in design view and click Format > Conditional Formatting.
 
Thank you very much for your quick reply Bob! Never thought the solution could be so easy!
However, this conditional formatting is a bit limited. I use a background color for my text box which isn't present in the pallet. Any suggestions how to define my condition a bit more specific, so I can use my own color? :confused:

Thanx again!
 

Users who are viewing this thread

Back
Top Bottom