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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sting function

Status
Not open for further replies.

rjoshi2

Programmer
Sep 10, 2002
110
US
Is there a function that will capitalize the first letter of the word and then make the rest of the word lower case?

EXAMPLES
ADMIN becomes Admin
admin becomes Admin

Any help would be appreciated.

Thank You,
rjoshi2
 
Hi rjoshi2!

You can use the StrConv function:

StrConv(YourField, vbProperCase)

hth
Jeff Bridgham
bridgham@purdue.edu
 
It's self explanatory, but...

StrConv(CurrentUser,vbProperCase)

Good luck
[pipe]
Daniel Vlas
Systems Consultant
 
Hi!

If I'm not mistaken the CurrentUser function returns a string so you should be able to put it in as the first parameter of the StrConv function. If that doesn't work then you can try it like this:

Dim strUser As String

strUser = CurrentUser()
strUser = StrConv(strUser, vbProperCase)

Then use strUser anyway you like. If you need this in a query then write it into a public function and return strUser. You haven't said how or where you want to use this information so a more specific answer isn't possible.

hth
Jeff Bridgham
bridgham@purdue.edu
 
When I use the strconv with currentuser all I get back is ???

 
Hi!

Where are you using this? Is it the control source in a form? Is it a calculated field in a query? We need more info!

Jeff Bridgham
bridgham@purdue.edu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top