Highlight between 3 fields

  • Thread starter Highlight between 3 fields
  • Start date
H

Highlight between 3 fields

Hello

I would like to inquire about the best way in this for highligts
There are three fields
[Price1] [Price2] [Price3]
In the report, which field contains the Lower price between the 3 fields
will look highlight color example red color.

If all fields contain numbers I would like to show the lower figure the
value of a red highlight color.
When there is figures in all these fields
[Price1] [Price2] [Price3]
Three can use the following to show the red color on Price1
[Price1] <[Price2] AND [Price1] <[Price3]

But if one of fields inside is Null does not appear red color to compare
between the two fields that have value.

Is it possible to arrange the code to reach its goal?
So íf one field is NULL still compare between the 2 fields and make
highlight between them that is lower price.

I mean the highlight between 3 fields and if one is NULL will be ignored and
compare between 2 that have value.

Thank you
 
J

John Spencer

One method, uSE the NZ Function to force a very high value before doing the
comparison

Nz(Price1,99999999999) < Nz(Price2,99999999999)
and NZ(Price1,99999999999) < Nz(Price3,99999999999)

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
 
H

Highlight between 3 fields

Hello
Thank you for your answer and it work, but see the result;

First example is OK:
[Price1] [Price2] [Price3]
4 8 8
Red color ok
--------------------------------
Second example:
[Price1] [Price2] [Price3]
4 Null Null
Red color
But cause it is alone price, so it dosn't need to be with red color. I mean
the red color highligt will appear only when there are at less 2 fields with
value.
Is it possible to fix the code?

Thank you for your help
 
J

John Spencer

Then you need to test for the presence of two null fields or two or more
non-null fields.

IF IsNull(Price1) + IsNull(Price2) + IsNull(Price3) < -1 THEN
'Do your other comparisons here
ELSE
'Turn off Red for all three controls
END IF

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
 
H

Highlight between 3 fields

Hello Mr John Spencer

I have solved it

Thank you very much and God Blesses
 

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

Similar Threads

Compare 2 Fields 1
SQL Query 1
Using the MIN function across fields in a record 7
Lookup in the Form 23
Report Calcuation 1
split function error 4
Date ranges 5
Sum fields in single record 1

Top