Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

  • Newbies
Posted

I have a field where people have already entered lots of comments with a date next to the comment in the date format x/xx/xxxx. I made a new layout where i want to display the data from this field but I want to have any dates show up in red. I Know the calculation for styling text red, and I know how to filter to find the date but I don't see how to make them work together. Any leads to a solution is much appreciated! Thanks!

  • Newbies
Posted

so here is an example of one record from my "comment" field:

"03/07/2007: Today this is my comment"

I have a lot of comments like this already entered.

The goal is to make a report layout that will printout all these comments with all the text, but anytime the date is displayed it would be red.

Posted

Ok

Give a try to this custom function:

/*

RedDates custom function

Format: RedDates ( text )

parameter:

text - a text that has a date on the left and a comment; it may contains many line such this

Returns the same text, but with red dates

*/

Let([

line = LeftValues ( text ; 1 );

next = RightValues ( text ; ValueCount ( text ) - 1 );

d = LeftWords ( line ; 1 );

rest = RightWords ( line ; WordCount ( line ) - 1)

];

Case(

Length ( next ) ; TextColor ( d ; RGB ( 255 ; 0 ; 0 ) ) & " " & rest & ¶ & RedDates ( next );

TextColor ( d ; RGB ( 255 ; 0 ; 0 ) ) & " " & rest

)

)

Posted

It almost always works better to have your comments (or notes) data as records instead of multilines within a text field. If you wish to sort (or restrict by date), you won't be able to do it. And if you wish to report at all, you won't be able to split the field back apart. Why put together just to break it apart again? You may also find the need to filter or display the comments by staff member who created them; which, if you captured the creator, would be easy. As it is, you'll again have to attempt to split the data. Management and staff may SWEAR they won't ever want this information but, sure as the sun rises, they most certainly will. :crazy2:

It takes no more work to set it up and it'll save you a ton of work later when you'll be changing your process AND attempting to split the data. Just a thought ...

LaRetta :wink2:

This topic is 6531 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.