Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Change color based on a parameter

Change color based on a parameter

Change color based on a parameter

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


RE: Change color based on a parameter

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:


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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close