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

Update Query Capitalizing First Letter

Status
Not open for further replies.

ebizleads

Technical User
Sep 14, 2005
57
US
I would like to take my [First Name] field and capitalize the first letter.

Would also like to take the [Address]and do the same, but this field has more than one word in it. Would like to capitalize the first letter in each word here.

Any ideas?

Thanks!

EbizLeads
 
Use the StrConv function - StrConv([FieldName], 3), where 3 represents the constant vbProperCase.

Roy-Vidar
 
Roy-Vidar has the correct solution. You may need to go back and do some manual editing if you have addresses like:
strConv("534 MCKINLEY AVENUE",3)
which will convert to
534 Mckinley Avenue

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
I use this UDF for the same purpose - thought I'd post a slightly different approach just for fun.

Code:
Public Sub ConvertToProper()
'Test if control contains text
    If IsNull(Screen.ActiveControl) = False Then
'convert text to Proper Case
        Screen.ActiveControl = StrConv(Screen.ActiveControl, vbProperCase)
    End If
End Sub



~Melagan
______
"It's never too late to become what you might have been.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top