Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Applying a text colour change to the original field where the data was entered ?


physik
 Share

Recommended Posts

Hi !

 

I'm a new user working on my first database. In this I have a field called “Malaria #2” that is setup as a drop-down list using a value list of “NEG”, “POS”, “EQ”, “ND”. I want to use a calculation to make the text colour red when “POS” is entered, purple when “EQ” is entered and blue for any other values. So I wrote the following calculation …

 

Case ( Malaria #2 = "POS" ; TextColor ( Malaria #2 ; RGB ( 255 ;0 ; 0 ) ) ; Malaria #2 = "EQ"; TextColor ( Malaria #2 ; RGB ( 255 ; 0 ; 255 ) ) ; TextColor ( Malaria #2 ; RGB ( 0 ; 0 ; 255 ) ) )

 

… which works fine when I apply it to a new field (eg. “Malaria #2 colour”), but I really want to be able to apply it to the original field where the data was entered in the first place. However, when I try to do this I can get an error result telling me that the original field is “not modifiable”. I have looked through both the field and layout settings to see if I can make the original field “modifiable”, but I can’t seem to find anything appropriate.

 

Is it possible to apply such a calculation to the original field where the data was entered or do I have to settle for entering the data in one field and seeing the calculated result (a simple text colour change) in another field ?

 

Many thanks,

 

Mark

Link to comment
Share on other sites

… which works fine when I apply it to a new field (eg. “Malaria #2 colour”), but I really want to be able to apply it to the original field where the data was entered in the first place. However, when I try to do this I can get an error result telling me that the original field is “not modifiable”.

 

Can you elaborate on "when I try to do this"? How, exactly, are you trying to do this?

 

 

Oh, and you might find it easier to set a highlight color behind the field itself rather than having the color of its text change.

 

To make the color of the original field change as a consequence of its own content pretty much requires a script. (There may be a non-scripted workaround but none immediately comes to mind. You can't auto-enter a calculation based on the field's own content, that's a self-referential loop). And if you want value lists, you can't just script a Show Custom Dialog ["Enter a value for 'Malaria 2' and hit 'ok' " field entry=TableName::Malaria 2; buttons=ok', 'cancel], so a scripted data entry is going to be a bit messy. (Again, there may be an elegant solution, but the only thing that immediately jumps to mind is a short pause before assessing field contents and applying text formatting based on that, which is not elegant and is messy)

Link to comment
Share on other sites

Thanks.

 

Having posted the question, I noticed the "Similar Threads" link directing me to this thread ...

 

http://filemakertoday.com/com/showthread.php?t=9819

 

... which led me to the answer. It seems that I should not redefine the field as a calculation, but rather leave it as text then go to the auto-enter options and select "Calculated value". In the resulting window, I enter the calculation as before and click OK to confirm and then finally I have to make sure that I unselect "Do not replace existing value for field (if any)". I then click OK to confirm again (twice) to apply these options and everything seems to work as intended.

 

The "Similar Thread" link certainly did a better job of searching the previous threads than my own efforts.

 

Cheers smiley-smile

Link to comment
Share on other sites

The calculation works fine as an "auto-enter replaces existing" with me

 

kjoe

 

Cool!

 

...... aside from what it implies about my memory.

 

 

::goes back and tries it out with various versions::

 

OK, it didn't let you do that in FileMaker 6. I ain't senile, I'm obsolete!

 

::stomps off muttering about young whippersnappers::

Link to comment
Share on other sites

This thread is quite old. Please start a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...

Important Information

Terms of Use