November 5, 20205 yr Newbies I use FM Pro 12, and I hope this is the correct forum for my first post. I have a text box on my website into which I often add dates in this format: 5th November 2020. Is there a way to have FM automatically change the “th” after the date number to the superscript version of itself? In other words, the date is entered as 5th November 2020, but FM changes it to 5th November 2020. By way of example, it is certainly possible to have Microsoft Office do this automatically, but I would like to know if FM is also capable of this function. Thank you Richard
November 5, 20205 yr You could define the field to auto-enter a calculated value (replacing existing value) = Substitute ( Self ; [ "August" ; Char ( 145 ) ] ; [ "st" ; TextStyleAdd ( "st" ; Superscript ) ] ; [ "nd" ; TextStyleAdd ( "nd" ; Superscript ) ] ; [ "rd" ; TextStyleAdd ( "rd" ; Superscript ) ] ; [ "th" ; TextStyleAdd ( "th" ; Superscript ) ] ; [ Char ( 145 ) ; "August" ] ) Edited November 5, 20205 yr by comment
November 6, 20205 yr Author Newbies I’m very grateful to you for your help, but I’m not quite sure how to assign what you wrote to the text field in question. I added it to the “Options – Calculated Value – (Specify) – Description and Information” dialogue box under “Manage Database” in Layout Mode, but that didn’t work. This leads me to think I’ve used it incorrectly rather than there being a problem with what you kindly wrote. Would you mind providing me with a little more guidance? I should stress I’m a newbie, so the more assistance, the better! Thank you again Richard
November 6, 20205 yr Are you using the English version of Filemaker? I don't recognize this description: 1 hour ago, Fudgemudge said: I added it to the “Options – Calculated Value – (Specify) – Description and Information” dialogue box under “Manage Database” in Layout Mode, You should select: File > Manage > Database… > Fields. Then select the text field in question, click Options… and choose the Auto-Enter tab: Select 'Calculated value' and enter the formula above into the `Specify Calculation for "YourFieldName"` window that will open. Click OK, then deselect the `Do not replace existing value of field (if any)` option. You don't need to be in Layout mode for this.
November 8, 20205 yr Author Newbies Thank you for your additional assistance. I have a comprehensive manual for FM12, and it tells me that when a field type is changed from (in this case), text to calculation, all the existing data in the field is changed or overwritten. I have a lot of data in this particular field, all of which I would prefer not to lose. Can you explain what will happen to the data if I change the field type from text to calculation? Thank you once again Richard
November 8, 20205 yr 1 hour ago, Fudgemudge said: what will happen to the data if I change the field type from text to calculation? Oh my. You should definitely NOT do that. I never suggested doing that. Please read more carefully. Also read this: https://fmhelp.filemaker.com/help/12/fmp/en/html/create_db.8.20.html#1029444
Create an account or sign in to comment