We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

FileMaker Pro 8.5 field fill color based on contents

bobrossi56
bobrossi56 asked
on
Medium Priority
1,259 Views
Last Modified: 2012-05-07
I am using this code:
Case ( Amt > 0 ; TextColor ( Amt ; RGB ( 0 ; 254 ; 0 ) ) ;
       Amt = 0 ; TextColor ( Amt ; RGB ( 0 ; 0 ; 0 ) ) ;
       Amt < 0 ; TextColor ( Amt ; RGB ( 254 ; 0 ; 0 ) ) ;)

to change the text color based on field content.

I tried the F1 help to see if there was a similar method to change the FILL color of a field based on content, but I found nothing. Can that be done as well.
thx experts...
BobR
Comment
Watch Question

Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview

Author

Commented:
I am an FM Pro newbie so you've lost me. An example would be wonderful.
thx
Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview

Author

Commented:
When you say "repeating container" field I do nto understand what you mean. I went into define database and added a new container field and I called it cont1. I filled the field with red. How do I make it repeat and use different colors?
thx

Author

Commented:
OK, I set up field "cont1" to repeat twice and it now shows up on the layout as cont[1] and cont, looks like 2 boxes now. However, when I click to fill the field with a color BOTH boxes fill with the same color. How do I get cont[1] as red and cont as green?
thx
D0N

Commented:
You're almost there.  Draw a green-filled box and drop into one repetition, create a red-filled box and drop it into the other repetition.

Author

Commented:
OK, done. Still confuse though. SO now I have this cont1 container field, 2 repititions, one repitition has a red box dropped over it, the other rep has a green box dropped over it.

How do I get field "cont1" to show green when field "total" is greater than 100 and show red when lit's less than 100 ?
thx
D0N

Commented:
Create another container field (there's another way to do this using the same field, but I won't confuse you), then make that field display the repetition you want like this:

Case ( total < 100 ; cont1[1] ; cont1[2] )
or
Case ( total < 100 ; GetRepetition ( cont1 ; 1 ) ; GetRepetition ( cont1 ; 2 ) )

Author

Commented:
Tried this, and I am getting SO close, but still not working. I am sure its something stupid I am doing. I have attached a small database that I am using to try to get this to work. Perhaps you can take a quick look at it and see the rrro of my ways. Just rename it from test.txt to text.fp7.
thx much...
test.txt
D0N

Commented:
Here you go
test.txt

Author

Commented:
OK, but a few ???
1. I don't see the reason to put the total field over cont2, because no matter what value is in the total cont2 shows as red.
2. Why are there now 2 cont2 fields on the form?
3. You annotated that cont2 needs to be a calc, but I did have it as a case calc.
4. I do see cont2 change colors depending on the total, but its a bit "kludgy" meaning that when its <100 the cont1 field is colored red/red, and when its >100 its colored green/red. The red/red is fine because red is red, but the green/red is just confusing.
5. Don't have any idea what this annotation means - While in layout mode, I copied your black box, then went into browse mode and pasted it into repetition 1

thx
D0N

Commented:
Hmmm...
1.  When I made total come out to less than 100, cont2 changed to black, when greater it changed to red.
2.  I just duplicated your cont2 field
3.  When I got it, cont2 was a container field.  However, at one time it looked like it was a calculation field as when I changed it to a calculation field, it had the calculation already there.
4.  Don't look at cont1 field, it's just holds colors your going to use.  Other than to "fill it", you don't need it on the layout at all.
5.  You need to get at the colored object to be able to copy it.  You can't get at it in browse mode.  (Incidentally, I didn't see a green... only black and red).

Author

Commented:
Weird, I see red and green.
OK, I understand your answers, but if I don't look at cont1 field, then all I see is cont2 field and that never changes color no matter what the total is.

I am confused by the copy and paste colored object. Do you have to do this for every new record? if so that was not my intent. In fact, when I use the test DB and create new records nothing changes color. Only the 2 records you put in there change color, and even those only change in cont1, cont2 with trans total always show red.
thx
D0N

Commented:
Sorry, my fault, conf1 should be a global field.  It does nothing more than hold your color pallet.  It's the same for all records.
If total is less than 100 your calculation should grab the appropriate color (repetition) that you specify, if it's greater than 100 it should point to the other repetition.

Author

Commented:
No prob, OK, now it works like I had visualized. Thanks for sticking with me and being patient. I appreciate all your help.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.