Newbies Fudgemudge Posted November 5, 2020 Newbies Posted November 5, 2020 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
comment Posted November 5, 2020 Posted November 5, 2020 (edited) 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, 2020 by comment 1
Newbies Fudgemudge Posted November 6, 2020 Author Newbies Posted November 6, 2020 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
comment Posted November 6, 2020 Posted November 6, 2020 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.
Newbies Fudgemudge Posted November 8, 2020 Author Newbies Posted November 8, 2020 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
comment Posted November 8, 2020 Posted November 8, 2020 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
Recommended Posts
This topic is 1546 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now