Page 1 of 1

Case Displayed in Popup List

PostPosted: Sat Jul 16, 2005 6:26 pm
by LDR
Is there any way to set text format in a popup list? I have all my customer fields set to display titlecase but over the years the text has been entered in all lowercase and some in all upper case. This makes the popup list look bad. I have even found records where half the input is upper and half lower. Short of having to retype all the bad entries is there a script that can fix the text or a way to set the format in the popup list.

Thanks

PostPosted: Sun Jul 17, 2005 9:57 am
by John Sindelar
As you've noticed, the pop-ups display the index of the field in question and do not respect field formatting: you have to change the data itself to change the appearance of the pop-up list.

Fortunately, FM7 gives us some cool ways to do this. One method is to use an Auto-Enter calculation that formats the text for you. Something like: Proper(MyField).

Be sure to *uncheck* "Do Not Replace Existing Value of Field (if any)". This will reformat the text in each field as soon as it is entered. Once this is in place you can fix legacy records by running a Replace command (put your cursor in the field in question and select Records / Replace Field Contents) on your found set, replacing each entry with itself (use a calculation that is nothing but the field itself). This will force the auto-enter calculation to fire, reformatting each record.

While you're at it, you can remove things like Bold, Underline, and Colors at the same time using something like: TextColor ( TextStyleRemove ( Proper ( text ) ; AllStyles ) ; RGB ( 0 ; 0 ; 0 ) )

(For a more interesting version of Proper() , check out this function.)

Hope that helps,

John

PostPosted: Sun Jul 17, 2005 4:02 pm
by LDR
Thanks John...

That did the trick. The index is now all the same and the field is set to format correctly no matter what gets typed.