Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change color based on a parameter

Status
Not open for further replies.

crytalbria

Technical User
Mar 25, 2020
7
GB
Thank you for your time. I've been knocking my head against the wall on this one.

I have a single value number parameter. I would like the below formula output to change color when the number entered in the parameter is >= its value.

If Not OnFirstRecord And
{@GapFromDate} >= Previous({@GapThruDate}) then
DateDiff ("d",{@GapFromDate},Previous({@GapThruDate})) Else 0

-----------------------------------------------------------------------

The formulas used above {@GapFromDate} & {@GapThruDate} are simple If then else formulas to grab the dates when they meet a simple criteria

-----------------------------------------------------------------------

I've found nothing that seems to work, I've tried to compare the output of the formula to the parameter, output the formula to a shared variable and compare it to the parameter. set up the parameter & formula output as global vars to compare those.. Nothing seems to work and I've run out of ideas.

Any help given would be greatly appreciated

-BV
 
You haven't said exactly what you want to apply the color too, or what you have tried. If it is the section background, in Section Expert, click on the Color tab and then on the X2 button and enter the following formula:

Code:
If      {@Your Test Formula} <= {?Your Parameter}
Then    crYellow 
Else    crNoColor

If you want to color the background of an individual field, right click the field and select Format Text, click on the Border tab. Click on the X2 box beside Background Color enter the above Formula.

Amend color references as appropriate.

Hope this helps

Cheers, Pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top