Solved

FileMaker Pro 8.5 field fill color based on contents

Posted on 2009-06-28
15
1,149 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
0
Comment
Question by:bobrossi56
  • 8
  • 6
15 Comments
 
LVL 9

Assisted Solution

by:jvaldes
jvaldes earned 50 total points
ID: 24733431
Best way to do that is to put the colors that you want to display into a repeating container field. Then Place the Field text over the container field and activate the repetition of the fill that you want to display. If you need an example let me know
0
 

Author Comment

by:bobrossi56
ID: 24734892
I am an FM Pro newbie so you've lost me. An example would be wonderful.
thx
0
 
LVL 3

Accepted Solution

by:
D0N earned 450 total points
ID: 24735933
Picture it as storing different colored boxes in container fields.  As jvaldes mentioned, a repeating field is the way to go.  Fill repetition 1 with red, repetition 2 with green, etc.  Display the appropriate color then (using a transparent background) place your numberic (or whatever) field over the top of that color.  

If you can upgrade to v9, you'll get built in "conditional formatting" which is exactly what you're looking for.  It allows you to change field formatting based on the value that's in the field.
0
 

Author Comment

by:bobrossi56
ID: 24737076
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
0
 

Author Comment

by:bobrossi56
ID: 24739988
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
0
 
LVL 3

Expert Comment

by:D0N
ID: 24745672
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.
0
 

Author Comment

by:bobrossi56
ID: 24746526
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
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 3

Expert Comment

by:D0N
ID: 24747031
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 ) )
0
 

Author Comment

by:bobrossi56
ID: 24747493
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
0
 
LVL 3

Expert Comment

by:D0N
ID: 24747921
Here you go
test.txt
0
 

Author Comment

by:bobrossi56
ID: 24748074
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
0
 
LVL 3

Expert Comment

by:D0N
ID: 24748705
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).
0
 

Author Comment

by:bobrossi56
ID: 24749254
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
0
 
LVL 3

Expert Comment

by:D0N
ID: 24749592
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.
0
 

Author Comment

by:bobrossi56
ID: 24750400
No prob, OK, now it works like I had visualized. Thanks for sticking with me and being patient. I appreciate all your help.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Problem: You have a hosted FileMaker database and users are tired of having to use Open Remote or Open Recent to access the database. They say, "can't you just give us something to double-click on rather than have to go through those dialogs?" An…
Having just upgraded from Filemaker 11 to Filemaker 12 over the weekend, we thought we would add some tips for others making the same move.  In general, our installation went without incident. Please note that this is not a replacement for Chapter 5…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now