Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

I am trying to make a field that will make the name of a student possessive so their name can be used in a possessive form automatically. Is there a way to make a formula/function that will look at the name of a student, see if the last letter of their name is

I assume you must be American if that's how you denote possessive form. smile.gif

Anyway, try this:

Name & Case(Right(Name,1)="s","'","'s")

and for all the rest of the world:

Name & "'s"

I'd Trim() the Name field's contents to get rid of any training spaces that may accidentally be entered.

  • Author

First, I want to thank both of you for your time and the solution to my queston. This was my first post and your response was fast and wonderful Thank You!

Next, what is a good book to aid in learning tricks like the one above? I have "FileMaker Pro" by Nolan Hester, "FileMaker Pro Advanced" by Cynthia L. Baron/Daniel Peck and "Learn FileMaker Pro" by Jonathan Stars. These seem to be good books but they seem to lack detailed explaniations on how all formulas/functions are used.

Finally, the Trim() worked great on spaces but not returns. Is there a way to prevent an accidental return?

Again, thank you very much for your help!

Elgin Cook

Alaska, USA

Hi Elgin,

Welcome to the list. It appears that you have a good assortment of books, You might want to add one more called Special Edition Using FileMaker Pro 5, by Rich Coulombre and Jonathan Price. However, the best way to learn IMHO, is to get your hands on as many tip and trick, example, sample files, etc. that you can and then tear them appart to see what makes them tick. The second thing is to try and accomplish or make a sample file on what others on list(s), such as this, are asking, and then, compare your answer to what is given by others. The Third thing is, while you are developing solutions, do *NOT* hesitate to ask your questions here, and on the other FileMaker list that you belong to.

If you need it, I can give you a list of sites (including here) for example files, and a list of other FileMaker lists you can join.

Now to answer the question about the paragraph, Use the substitute step with the calculation:

Trim(Substitute(Name, "?", "") & Case(Right(Name,1)="s","'","'s")

)

HTH

Lee

cool.gif

I should have tried this calculation before posting, there is an error in it, so don't use.

Lee

;(

Hi Elgin,

I came up with this calculation, only problem is that it breaks if the name ends in "S" and the user puts in a paragraph. I'm still working on it, however, maybe someone else can come up with something better for you.

frown.gif

LeftWords(Trim(Name), WordCount(Trim(Name))) & Case(Right(Trim(Name),1)="s","'","'s")

HTH

Lee

To remove paragraphs use this function:

Substitute(textfield, "

Hi Vaughan,

I tried that first and it wouldn't work with when coupled with the Trim and Case functions.

Lee

Nope, tried that one too, and also breaks with the s ending names

;(

What is TEST?

Hi Elgin smile.gif

You are wise to question how to remove those pesky carriage returns!! I highly suggest you strip them from your text fields (except for multikey fields) during data-entry as they will cause problems for you in many ways.

You can search for "Carriage Returns" on this Forum for a range of ideas on stopping them from being entered, and also how to strip them from your existing dBs. This Forum has been invaluable to me on this very issue.

If you would more help on this subject after researching on Forum, post a new question and we'll help you with it.

LaRetta

Here is the function that strips returns, trims spaces and adds the apostrophe:


Trim(Substitute(textfield, "

Hi Vaughan,

Sweet!

Lee

TEST = CASE in French. Sorry for that. Vaughan's is sweatest but this also works for what I've tested.

As a matter of interest (and at the risk of gilding Vaughan's lily), I'd make the following observations:

1. Nesting Substitute and Trim is redundant - the effect of both can be achieved simultaneously with the Xwords functions.

2. The use of Lower( ) is redundant, since boolean tests are not case sensitive.

Thus a more compact expression which will achieve the desired outcome is:

LeftWords(YourText, 99) & Left("'s", 2 - (Right(LeftWords(YourText, 99), 1) = "s"))

The use of Left( ) rather than If( ) or Case( ) for the closing statement is, admittedly, purely arbitrary... wink.gif

Hi Ray,

I don't know how you can imagine such calculations tongue.gif , starting with Left and Leftwords when we are looking to correct the Right part of the Name confused.gif . You may be a very complicated guy grin.gif!!! but it works great.

Your solution not only "trim" spaces and carriage return at the end of the text field entry but also every clipboard of type "

I hereby formally declare my lily well and truly gilded!

Hi Ray,

Very niice, so smoooooooooooooth.

At least I started out in the right direction using LeftWords.

Thanks for the calculation, I know I'll have a use someday for this one.

Lee

tongue.gif

  • Author

Just a quick note to let all those who helped out in this. I truely appreciate it! I think I found the REAL place to learn. :-)

Elgin

All this to have ownership.....

Who'd have thunk it?

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.