Connecting Tech Pros Worldwide Forums | Help | Site Map

convert strings to proper case

Member
 
Join Date: Jan 2007
Posts: 53
#1: Feb 24 '07
Hello please can someone help me with the problem of automatically changing the first letter of surnames and names into capital letters.
i am able to do the postcode where in the format box i typed in ">", to get all the letter inm capital letters. i do not know if the character lenght is important.
cheers

ADezii's Avatar
Expert
 
Join Date: Apr 2006
Location: Philadelphia
Posts: 5,214
#2: Feb 24 '07

re: convert strings to proper case


Quote:

Originally Posted by panjap

Hello please can someone help me with the problem of automatically changing the first letter of surnames and names into capital letters.
i am able to do the postcode where in the format box i typed in ">", to get all the letter inm capital letters. i do not know if the character lenght is important.
cheers

The StrConv() Function with the vbProperCase Parameter will convert the first letter of every word into Upper Case.
Expand|Select|Wrap|Line Numbers
  1. Debug.Print StrConv("john wilkes booth",vbProperCase)
  2.  
  3. Output:
  4. John Wilkes Booth
Member
 
Join Date: Jan 2007
Posts: 53
#3: Feb 26 '07

re: convert strings to proper case


Quote:

Originally Posted by ADezii

The StrConv() Function with the vbProperCase Parameter will convert the first letter of every word into Upper Case.

Expand|Select|Wrap|Line Numbers
  1. Debug.Print StrConv("john wilkes booth",vbProperCase)
  2.  
  3. Output:
  4. John Wilkes Booth


thankyou for your help, and i am sorry for the late reply
i do not understand what the vbProperCase Parameter is and i tried to directly pate this into the code format in access but it did not work. have you got any sugesstions.
cheers for your help, much appreciated!
ADezii's Avatar
Expert
 
Join Date: Apr 2006
Location: Philadelphia
Posts: 5,214
#4: Feb 27 '07

re: convert strings to proper case


Quote:

Originally Posted by panjap

thankyou for your help, and i am sorry for the late reply
i do not understand what the vbProperCase Parameter is and i tried to directly pate this into the code format in access but it did not work. have you got any sugesstions.
cheers for your help, much appreciated!

The 2nd Parameter to the StrConv() Function, in this case vbProperCase, tells the Function what display format to produce the result in. in this specific case, vbProperCase tells the Function to convert the first letter of every word in the string to uppercase. I see no reason why it will not work for you. Please post your code and I'll have a look.
Reply


Similar Microsoft Access / VBA bytes