First Letter Capatilazion

D

Dave

Any way to automate the "Proper" capilization in text fields?
I know you can use the > in the format property of a field to get ALL CAPS
but how can I format so that the first letter in certain fields is a
capital?

Thanks
dave
 
M

missinglinq via AccessMonster.com

'This caps first letter of textbox value
Private Sub TextBox_LostFocus()
Me.TextBox = UCase(Left(Me.TextBox, 1)) & Right(Me.TextBox,(Len(Me.TextBox)
- 1))
End Sub

'This caps first letter of each word in text box
Private Sub TextBox_LostFocus()
Me.TextBox = StrConv(Me.TextBox, vbProperCase)
End Sub

This Input Mask forces first letter of textbox value to caps
L<????????????

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via AccessMonster.com
 
D

Dave

Sweeeeeet,

the input mask was exactly what I wanted
but the capping of EACH word in a text box was a major bonus (and damn if it
didn't work in the address field also).
Not sure I really understood your first batch of code - but the others were
great.

Thanks much

dave
 
M

missinglinq via AccessMonster.com

The first code does the exact same thing as the Input mask, putting the first
character only of the textbox in caps, just doing it after the fact. The line

Me.TextBox = UCase(Left(Me.TextBox, 1)) & Right(Me.TextBox,(Len(Me.TextBox)
- 1))

should all be on one line. The interface here makes it difficult to present
code intact.

Glad it helped!

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via AccessMonster.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top