Dusty_Rods Posted August 26, 2005 Posted August 26, 2005 Hello all, Ok so i have a nice formatting calculation on my surname field. So when you put in smith It will capitize it to read Smith. However being from ireland we have a lot of second names like O'Malley and O'Brien. Now the proper function really doesnt work with this guy for obvious reasons it only caps the first letter when it should do it with the first two letters. My current code: Case ( Login::Formatting = "On" ; Proper(Surname) ; Login::Formatting = "Off"; Surname ) I do it on a global formatting on off field so they can turn it on and off. I have tried to proper the character using leftword and counting in the character but nothing seems to work any advice on this i would be very grateful. Thanks, D
SlimJim Posted August 26, 2005 Posted August 26, 2005 For the names with an apostrophe, such as the ones in your post you could use an Auto-enter calculation (replace existing) Substitute(Proper(Substitute(Name;"'";" "));" ";"'") this will not affect single word entries and will take care of o'malley etc.
comment Posted August 26, 2005 Posted August 26, 2005 That's a good idea, but using space alone is not safe enough - some names might contain genuine spaces (e.g. "van damme" -> "Van'Damme"). Either use a word delimiting character that is (more) unlikely to appear in a name, such as !, #, $, etc., or surround the apostrophe with spaces: Substitute ( Proper ( Substitute ( Name ; "'" ; " ' " ) ) ; " ' " ; "'" )
Dusty_Rods Posted August 29, 2005 Author Posted August 29, 2005 Hi guys thanks for the feedback however neither of those worked. What i want to happen if the user types in o'malley it goes to --> O'Malley O'malley it goes to --> O'Malley it will capitize the letter before and after the apostrophe. Thanks again guys , D
Lee Smith Posted August 29, 2005 Posted August 29, 2005 Take a look at the file I attached to my second post Here. The file is a version 3, but it will convert. HTH Lee :cool:
comment Posted August 29, 2005 Posted August 29, 2005 neither of those worked Then I guess you have smart quotes enabled (in File -> File Options... -> Text). Try to copy/paste the following formula. If it still doesn't work, type o'malley into name field, copy the apostrophe character, go into Define Fields and replace the single quote in the formula with apostrophe. Substitute ( Proper ( Substitute ( Name ; "’" ; " ’ " ) ) ; " ’ " ; "’" )
Recommended Posts
This topic is 7094 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