Open field options for your text field. Select the calculation option. Copy and paste this expression as the calclation:
TextFormatRemove ( Self )
Clear the "do not replace existing value...." check box. This also prevents users from using the text formatting bar to apply a text style.
That worked. Thanks!
Here's a question:
About 90% of my fields could be copied or pasted into. I like the OP would like to remove formatting....
However, making all the fields as calculations could really mess up some of the referenes I do for things like value lists, etc. Any way around this?
In Custom Menus change the Paste command to Paste without style
Would that cover using the keyboard shortcuts too?
The fields are NOT calcluations. they are text fields witn an auto-entered calculation. They will work fine as the source of data for a value list and can be formatted with value lists as well.
Keyboard shortcuts are shortcuts to menu items. So ... yes.
Phil would you recommend doing this over the changing of the paste command in the menu? Given that I'll have to go to a bunch of fields and change their calculations?
Each has its advantages and disadvantages. You'll need to weigh them in light of your design needs and preferences.
Custom menus aren't an option if you don't have FileMaker Advanced.
A Custom menu only affects the fields on a specific layout, but then makes this the case for ALL fields on the layout.
An auto-entered calculation affects a single field, but you'll see it implemented every where in your database.
Note, by using self, like I did in my original response, you get a generic expression that can be copy/pasted into the specify calculation for each field where you want to add this calculation. Of course, if there is already a calculation in use, you'll need to combine the calculations not just paste this one in.
So I think for what I'm doing, the auto-enter calc will be better. However, I have a couple sets of fields that already have a calculation in them (the calc copies the main address into either the shipping or billing address fields). Would I just add an AND to the calc in order to do both?
An And makes it a boolean expression--an expression that evaluates as 1 for True and 0 for False--not what you want here.
Nest one expression inside the other.
Say your current expression is:
TextformatRemove ( RelatedTable::Address )
Or you can set this calc up on the address field in the related table and leave it out of this specific calculation.
Ps. You can use TextFormatRemove with the Replace Field Contents tool in the Records menu to do batch "clean up" operations on data entered before you got this calculation installed.