formatting text

  • Thread starter Thread starter DA
  • Start date Start date
D

DA

I'm trying to create a form in my database. I want one of
the fields to be a title. What I want to happen,is when I
enter the text each word is capitalized. Is this possible?
I can get it to capitalize the first word but not the rest.
 
I'm trying to create a form in my database. I want one of
the fields to be a title. What I want to happen,is when I
enter the text each word is capitalized. Is this possible?
I can get it to capitalize the first word but not the rest.

Sound like proper case, use the StrConv function...

StrConv("this or that",vbProperCase )
This Or That


- Jim
 
I can't get that to work either. Either I'm not inputting
the command correctly or I'm doing something else wrong.
 
DA,

Since you didn't mention what you have done, I can't comment on why it
doesn't work. But probably the best place to process this is on the
After Update event of the textbox. For example...
Me.MyControl = StrConv(Me.MyControl, 3)
 
Do you want it to do proper case *as* you are typing it in? If so then
that sounds like an input mask - I don't know of one that will do
that.

What you could do is to force it to proper case *after* it is updated.

==========
Private Sub txtBox_AfterUpdate()
Me.txtBox = StrConv(Me.txtBox, vbProperCase)
End Sub
==========

- Jim
 
Back
Top