Tilted Forum Project Discussion Community  

Go Back   Tilted Forum Project Discussion Community > Interests > Tilted Technology


 
 
LinkBack Thread Tools
Old 02-12-2005, 09:18 PM   #1 (permalink)
Junkie
 
CBlend's Avatar
 
Location: Classified
[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.
CBlend is offline  
Old 02-13-2005, 06:34 AM   #2 (permalink)
Darth Mojo
 
mojodragon's Avatar
 
Location: Right behind you...
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.
mojodragon is offline  
Old 02-13-2005, 07:00 AM   #3 (permalink)
Getting it.
 
Charlatan's Avatar
 
Super Moderator
Location: Lion City
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.
__________________
"My hands are on fire. Hands are on fire. Ain't got no more time for all you charlatans and liars."
- Old Man Luedecke
Charlatan is offline  
Old 02-13-2005, 11:23 AM   #4 (permalink)
Junkie
 
CBlend's Avatar
 
Location: Classified
Thanks, mojodragon. Hope you are better at this than I am because figuring this out is killing me!
CBlend is offline  
Old 02-14-2005, 07:04 AM   #5 (permalink)
zen_tom
Guest
 
Write your own function - this one should do the job:

Code:
Function McStrConv(expr As Variant) As String
Dim ThirdChar As String
McStrConv = StrConv(expr, 3)
If Left(McStrConv, 2) = "Mc" And Len(McStrConv) > 2 Then
    ThirdChar = UCase(Mid(McStrConv, 3, 1))
    McStrConv = "Mc" & ThirdChar & Right(McStrConv, Len(McStrConv) - 3)
End If
End Function
 
Old 02-14-2005, 07:08 AM   #6 (permalink)
zen_tom
Guest
 
Expression builder should also be able to manage this, but it sucks so badly I try to avoid it.
 
Old 02-16-2005, 05:05 PM   #7 (permalink)
Junkie
 
CBlend's Avatar
 
Location: Classified
Thanks, zen! If I can stay out of meetings long enough to do some actual work tomorrow, I'll give it a shot!
CBlend is offline  
 

Tags
access, case, names, proper


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -8. The time now is 10:42 AM.

Tilted Forum Project

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
© 2002-2012 Tilted Forum Project

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62