Here's an image
Your image is missing. If you want the first letter of a field to be capitalized then use auto-enter calculation. Proper(Self) then remove the check from the check box do not replace existing value.
No image shows, but an auto-enter calculation could handle a single instance of a hyphen pretty easily. If you need to have this work for an unknown number of hyphenations, you may want to set up a custom function (requires FileMaker Advanced).
Let ( [ p = Position ( self ; "-" ; 1 ; 1 ) ;
L = Length ( self ) ;
s2 = Proper ( Right ( self ; L - p ) )
If ( p ; proper ( Left ( self ; p ) ) & s2 ; Proper ( self ) )
) // Let
That's nearly exactly what I figured out as to how to get a properly displayed hyphenated name.
I still have the problem: As an input text field, where do put that code to make it display in the edited text field.
I tried as a calculated value defining the field but that did not work. Do I need to create another field, modify the name and then replace the original?
I did try that and my same Last Name edit field remains the same.
Find the field in Manage | database | fields and double click it to open field options. Then select the calculation option on the auto-enter tab.
Please note that this will modify new data, but data in existing records will remain unchanged. You may want to use replace field contents with a very similar calculation (but no "self") to update them.
AWESOME!- it fixed all the hyphenated names in my 23k name database! Thank you! I was close with what I had (at least on the right track). If I can ask one more question about your code. Using "self" - is that how you refer to the field name you are modifying? I've always used the field name in the calculation but if this is the case, it would be simpler to use "self." I've seen "self" in some of the other examples and was not sure how it was being used.
In an auto-entered calculation and a conditional format expression, it can be used in place of naming the actual field and this can also produce an expression that you can paste into the calculation dialog of multiple fields without needing to modify it after pasting.
In my test, my calculation capitalizes each name no matter the number of hyphenations. Am I missing something.
Auto Enter Calculation
then uncheck do not replace existing value. My formula seem shorter and easier to use.
This is an amazing solution. Thank you to everyone!
How do you deal with a similar solution in a data entry field when someone is entering a last name for McGee or MacGregor and the G has to be capitalized.