Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Proper case (upper case) Names 3

Status
Not open for further replies.

mok44

MIS
Sep 3, 2002
36
US
Is there a way (or function) in VB that will correct the case on proper names (upper case on first letter in Last and First names)?
Thanks.
 
Thanks to PHV (a member here), I can tell you about...

txtField = StrConv(txtField, vbProperCase)

...simple, but effective!

(Should've seen the length of code I had, to achieve this, prior to learning about StrConv().LOL)!

Good Luck!
 
I tried using this function and got an error saying type conversion failure.

I referenced it in an update query like so ...
in the cell had the following ...

StrConv([Search Term], vbProperCase)?

Is this not allowed?
The field in question is a simple text field, so I am not sure why I am getting an "type conversion failure", unless this isn't allowed in the query? This is a public function, is it not?

David Pimental
(US, Oh)
dpimental@juno.com
 
I don't think a stored query recognizes the vbProperCase constant, try replacing with the value of the constant: 3

If that's not enough, try creating a public "wrapper" function for it.

Roy-Vidar
 
That did the trick. Thanks a lot.



David Pimental
(US, Oh)
dpimental@juno.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top