September 11, 200223 yr I have a calculated summary field and, as a user enters data, I would like the summary to turn red if it goes negative. For instance, remaining contract $ available. If user spends too much, I'd like the Bal Remaining to go red & bold so user can see it immediately. Can this be done?
September 11, 200223 yr This is done by stacking two calculated fields with different formatting, one black and the other red and bold, the top one set to be transparent. The trick here is that you can't just use a summary field in a calculation. THIS WON'T WORK!! DisplayBlack (calculation, number) = If(SummaryField>=0, SummaryField, "") DisplayRed (calculation, number) = If(SummaryField<0, SummaryField, "") THIS WON'T WORK!! Since the value of a summary field is context sensitive based upon what layout part it is located in, you must EXTRACT a value from a summary field using a GetSummary function. THIS WILL WORK!! DisplayBlack (calculation, number) = If(GetSummary(SummaryField,BreakField)>=0, GetSummary(SummaryField,BreakField), "") DisplayRed (calculation, number) = If(GetSummary(SummaryField,BreakField)<0, GetSummary(SummaryField,BreakField), "") THIS WILL WORK!! The "BreakField" is either: 1) If you are placing DisplayBlack and DisplayRed in a Subsummary part, BreakField is the "Subsummary when sorted by" field. 2) If you are placing DisplayBlack and DisplayRed in a Trailing Grand Summary part, BreakField is just the SummaryField. Sorry, sometimes there just isn't a really simple answer! -bd
September 11, 200223 yr You can format the number to show negatives in red. Go to format Number and click on show as decimal and it will give you the options.
September 11, 200223 yr Thanks Bob, exactly correct. Just got on cruise control answering the same as for more complicated tests. -bd
September 11, 200223 yr Author Hi Bob. I did that and it didn't work -- probably because my Summary wasn't even working yet - go figure! I guess I just got ahead of the problem. Rushing a bit too much. In Approach, it took LotusScript to change a font color, and I assumed it would in FM also.
Create an account or sign in to comment