Newbies loopymonkey Posted March 8, 2007 Newbies Posted March 8, 2007 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!
Raybaudi Posted March 8, 2007 Posted March 8, 2007 Hi when you say: "...with a date next to the comment... ", do you mean: date comment or comment date ?
Newbies loopymonkey Posted March 8, 2007 Author Newbies Posted March 8, 2007 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.
Raybaudi Posted March 8, 2007 Posted March 8, 2007 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 ) )
LaRetta Posted March 9, 2007 Posted March 9, 2007 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. 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:
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now