formatting text

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.
 
J

Jim Allensworth

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
 
D

DA

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

Steve Schapel

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)
 
J

Jim Allensworth

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
 

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