Conditional formatting in VB?

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

Guest

I'm trying to apply conditional formatting to a field on my report. If the
value in a control is bigger than the greatest of two other controls I want
it to display in red else in black.
I cannot figure out how to refer to the report fields and properties. The
prompting does not give me access to the forecolor property when I type in
Me!ActHrs

Access help as usual is of no help whatsoever

Any help appreciated.
 
If you are using Access 2000 or newer, you can do this by setting
Conditional Formatting option on the textbox in the report. Open the report
in design view, right click the textbox, and choose Conditional Formatting.
Set the drop down to Expression Is and in the box next to it type

[ThisField]>[OtherField1] And [ThisField]>[OtherField2]

Set the color as desired.

Anther way of looking at your restriction is this, if this value is larger
than the largest of two other values, then this value is larger than each of
the other two values. This is what has been used in the expression.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top