Jump to content

Recommended Posts

  • 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

Link to post
Share on other sites

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 by comment
  • Like 1
Link to post
Share on other sites
  • 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

Link to post
Share on other sites

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:

image.png.f6a7a4beedc457e30a2017852cc5c939.png

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.

 

 

Link to post
Share on other sites
  • 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

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.