![]() |
[MS Access] Proper case with "Mc" names
I have customer data I've imported into Access, and one of my Update queries converts the person's last name to proper case (so that SMITH becomes Smith, for example.)
In the "Update To:" part of the grid for this field, I have this function: StrConv([LastName],3) The problem is when Access encounters a "Mc" name, such as "MCCLOSKEY". The StrConv function gives me "Mccloskey", but I would like "McCloskey". Has anyone else done this? Please? :) I tried using the Expression Builder to make a function that looks at the first two letters of the last name, so that if it is "MC", then concatenate "Mc" & the Proper case of the rest of the characters in the string -- "Closkey." Maybe I built it wrong, but I think such a thing is possible. |
I would have to tinker with it for a while, but I'm sure it's possible. Let me play around with Access for a while, and I'll let you know.
|
It has been a while since I played with access but couldn't you do a filter for all instances of "cc" and then find and replace the "cc" with "cC"...
Just a thought. |
Thanks, mojodragon. Hope you are better at this than I am because figuring this out is killing me!
|
Write your own function - this one should do the job:
Code:
Function McStrConv(expr As Variant) As String |
Expression builder should also be able to manage this, but it sucks so badly I try to avoid it.
|
Thanks, zen! If I can stay out of meetings long enough to do some actual work tomorrow, I'll give it a shot!
|
All times are GMT -8. The time now is 11:57 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
© 2002-2012 Tilted Forum Project