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 font color using onfirstrecord 1

Status
Not open for further replies.

crytalbria

Technical User
Mar 25, 2020
7
GB
Hello Tek-Tips

I created the following formula to return the total days between two dates. I would like to change the font color when the total days between the two dates are equal/greater than 60.

unfortunately, I've been unable to complete this task was utilizing 'onfirstrecord' within my formula.

Tried changing the font color via the format editor with the following, but the EvalutateAfter is ignored:

EvaluateAfter(Gapdays);
if {@Gap Days} >= 60 then red else black


//Formula Name: Gap Days
whileprintingrecords;
if not onfirstrecord and
date({R.GapFromDate}) >= date(previous({@Thru Date})) then
datediff("d",date({R.GapFromDate}), date(previous({@Thru Date}))) else 0

Any thoughts on how to work around this?

Thank you for your time.
-B
 
First get rid of the whileprintingrecords and then create a formula right in the color formula area:

If not onfirstrecord and
date({R.Gapfromdate})>date(previous({@ThruDate})) and
Datediff(“d”,date({R.GapFromDate}), date(previous({@thruDate}))) then
crYellow else
crNoccolor

Not sure what is in {@ThruDate} formula, so if this doesn’t work, please show the contents of that formula. Also be sure to replace the quotes in my formula above with straight ones.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top