Using StrConv function to transform text to Proper

bearcub

Well-known Member
Joined
May 18, 2005
Messages
734
Office Version
  1. 365
  2. 2013
  3. 2010
  4. 2007
Platform
  1. Windows
I have a database where I have several fields text in different formats (i.e. names that are all capitalized or words that are all lower case or words that are in proper case).

I would like to convert all the records to Proper Case so they all follow the same format.

In Excel, I've used the Proper function to do this but it seems that this function doesn't exist in Access. So, I found that "StrConv" performs the same task as the Proper function.

This function works great but I did find out that names that use hyphens - like in married names have a minor issue. StrConv function converts all letters appearing after a hyphen in lower case - it seems to consider a hyphen as a letter.

Example: "Rose-Williams" or "ROSE-WILLIAMS" or "rose-williams" becomes Rose-williams after the StrConv function is applied to the field - which is not what I want. Rose-Williams is the output that I need.

Is there a work around to this so that all names are in proper case and the words after a hyphen are capitalized or am I not using this function correctly. I am using 3 as the 2nd parameter.

Thank you for your help,

Michael
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
thank you Joe4. I used the function in my query and it worked great.

Can I use this function in my original table -- it's linked to an Excel table which contains data that is dumped from the company database we use at work.

Thank you,

Michael
 
Upvote 0
I don't know, you would have to try.
The newer versions of Excel allow you to use Calculated fields in Tables, though it is not recommended and I would never do it. It kind of violates of rules of data normalization.
Typically, all calculations should be done on the Query level as opposed to the Table level.
But, if you have a newer version of Excel, and would like to try, see what happens. I am not sure if User Defined Functions will work in Access tables though.
 
Upvote 0

Forum statistics

Threads
1,223,907
Messages
6,175,300
Members
452,633
Latest member
DougMo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top