Page 1 of 1

Alternating Colours on a list by field value

PostPosted: Thu Oct 13, 2005 8:40 am
by David Fox
Hi,

I hope you could tell me how/if the following calculation is possible in FM6.

What I want to achieve is a calculation that alternates the background colour on a list depending on whether the value of a particular field in the NEXT record changes.

I know how to alternate a background field colour but I want to take this a bit further.

For example, if I have a list of 200 appointment dates together with the company name etc. on a list layout, it would be great if, once sorted by date, the background colour could alternate according to whether the date changes, thereby giving me blocks of colour separating each group of dates.

What I’m after is a calculation something like:

Alternating Colour Field =

If (statuspreviousrecord) Datefield = Datefield, Glo_Colouryellow,Glo_colourgreen)


Where the colours I want are held in the global fields.

Obviously I’ve just made this up! But if there is a way of getting Filemaker to compare records with the previous one in a list via a calculation rather than a script, it would be very helpful.

Sorry if there’s an obvious answer and apologies about the calculation syntax.

Thanks for any help you can offer.

Best regards
David

PostPosted: Thu Oct 13, 2005 10:11 am
by John Sindelar
GetNthRecord(DateField;Get(RecordNumber)- 1)

...will return the date from the previous record in your list in FM8. In FM7, you may want to simply assign colors to dates and leave it at that. By that I mean that given a table of 31 colors, you could assign one color each day. Then, items sharing the same day would have the same color. Wouldn't work if days shared the day but in different months, but they might not be beside each other anyway.

PostPosted: Fri Oct 14, 2005 4:02 am
by David Fox
Thank you once again.

Best regards
David