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

Cap 1st letter(s) of word(s) in Field

Status
Not open for further replies.

cwash

Technical User
May 27, 2002
45
0
0
US
I would like to have the 1st letter of a word(s) in a field to be uppercase. I've found some help out there but I don't know enough about 'codes' to make get it to work.

Can someone give me the code and simple instructions on where to put the code to achieve what I need?

Form name= employees
Field 1= first name
Field 2 = last name

Thanks in Advance!!
 
You can give 2 things a try.
1. Enable AutoCorrect in MS Access
Tools > AutoCorrect Options.. and enable Capitalization.

2. An input mask such as;
Private Sub TextBox_LostFocus()
Me.TextBox = StrConv(Me.TextBox, vbProperCase)
End Sub
 
Thanks ArtimusTek-

What code and what event do I use if my field has numbers and text, such as an "Address" field?

My "Address" field needs to contain both: "123 Street Name"

Thanks again!!
 
Should be the same. It formats the whole text box, not just the first letter. Numbers shouldn't interfere either.
 
How are ya cwash . . .

In an update query set [blue]Update To[/blue] as follows:
Code:
[blue] StrConv([[purple][b][i]FieldName[/i][/b][/purple]], vbProperCase)[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see FAQ219-2884:
 
Thanks again! It's working!

One other question if I may-

I'm curious what the other events, such as "on key press" ; "on change" ; and the other events can do.

So, can you recommend a good link that shows examples of what the 'events' do and/or can be used for?

Thanks again.
 
cwash . . .

Put the cursor on the event line (as if your were going to enter something and hit [blue]F1[/blue] . . .

In any code module , put the cursor on a word and hit [blue]F1[/blue] . . .

Its called [blue]Context Sensitive Help![/blue] . . .

Calvin.gif
See Ya! . . . . . .

Be sure to see FAQ219-2884:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top