If example 1 and example 2 are the contents of the same field but in different records:
F = yourField ; // you could even use Self in an auto-enter text field
dash position = Position ( F ; "-" ; 1 ; 1 ) ;
First Part = Trim ( Left ( F ; dash position - 1 ) ) ;
Second Part = Trim ( Right ( F ; dash position + 1 ) )
PatternCount ( F ; "-" ) ; TextColor ( First Part ; RGB ( 255 ; 0 ; 0 ) ) & " - " & Second Part ;
I tried your method above but it doesn't seem to be working. The entire field is getting highlighted by a color.
And yes, both examples I gave are from the same field. Some contain One 4-digit code and others contain multiple 4-digit codes. Also, I I'm planning on using Conditional Formatting so wouldn't I set the color in there, vs in the actual formula?
A conditional format expression cannot color just part of an object. You specify a format (such as a color) for the entire object. You must either use two objects or use Raybaudi's calculation in a calculation field that you then place on your layout.
Sounds good. Thanks for the help :)
I just ended up splitting the 4 digit code into it's own field and made it related to the description.