Alternating Colours on a list by field value

General support questions.
Posts: 58
Joined: Tue Jul 26, 2005 12:08 pm
Location: London
PostPosted: Thu Oct 13, 2005 8:40 am
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
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Thu Oct 13, 2005 10:11 am
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.
John Sindelar
SeedCode
Posts: 58
Joined: Tue Jul 26, 2005 12:08 pm
Location: London
PostPosted: Fri Oct 14, 2005 4:02 am
Thank you once again.

Best regards
David

Return to General Support

Who is online

Users browsing this forum: No registered users and 3 guests

(855) SEEDCODE
[email protected]
Follow us: