Jump to content

Making each item in a value list a different color


rkmossm

This topic is 8324 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

I have a value list called "household" that contains the names of ten households in a club. They show up as radio buttons. Each member can belong to one and only one household.

I need to develop a layout that shows the members name and household. But, each household name needs to print out as a different color. I know I can set the field to any given color as a general case, but how do I set the color of the text (not the field) based on the household.

Basically, this is going to end up as a poster for an end of year party where people will get prizes based on the number of points they have earned for their various activities. The poster will be in order of highest point-getter to lowest. But, they want the poster to also show the households of the members in various colors so they are easy to spot and the household can get some "bragging" rights.

TIA

Link to comment
Share on other sites

The only “decent” way to do this – until FM gets around to seeing why this function is important – is to think backwards. I’ll explain: Don’t think about 1 field switching between, lets say, 5 colors depending on a value. Think about a value switching fields depending on a value. Take a look at this:

Fields.

<Household>

<House-Red>

Case ( Houshold = "Smith"; Household; "" )

<House-Blue>

Case ( Houshold = "Harris"; Household; "" )

(REMEMBER – The separators here will be different to yours, as I’m in Europe – so I think where I’ve used a semicolon, you need a comma etc.)

The calculating fields are then set to transparent and placed over each other on the layout. Each is set to a different color, and only displays if a condition is met – in this case “Smith” will result in the first field (set to red) displaying, and “Harris” the second field (set to blue). You can create as many color fields as you want. The best way is to put the actual field <Household> at the bottom of the layout, and then set all the others not to allow entry – this way you can still enter and change data, and perform finds. You could also use a series of global fields for entering the household names, and then use these fields in the Case statements above instead of entering each name. This allows other users to add or remove households to the list.

I hope this helps. But if you don’t know this trick, then I guess your relatively new to Filemaker, so may have some problems understanding this. If so, let me know and I’ll send you an example of this.

Rigsby

Link to comment
Share on other sites

This topic is 8324 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.