Title case using Input masks

G

Guest

I have a database which has names eg Road Train in the same table. What I
would like to do is to create an input mask which makes the first letter of
each word a Capital and the rest lower case.. I know that this expression is
used <L>??? but how do I get the next name in capital? The names are not the
same length and so I strike difficulty if I create another expression next to
it in the input mask wizard.

I really want to have the two to three words in title case, and do not want
to separate them into a table for each word.
 
R

Rick Brandt

Just-lemons said:
I have a database which has names eg Road Train in the same table.
What I would like to do is to create an input mask which makes the
first letter of each word a Capital and the rest lower case.. I know
that this expression is used <L>??? but how do I get the next name in
capital? The names are not the same length and so I strike difficulty
if I create another expression next to it in the input mask wizard.

I really want to have the two to three words in title case, and do
not want to separate them into a table for each word.

Input masks are evil. Use the AfterUpdate event to reformat the text and don't
worry about how the user types it.
 
G

Guest

Hi Rick

In that case how would you write the afterupdate event procedure? And is it
possible to make say 3 out of the 6 fields do this automatically without
having to do an event procedure for each field?
 
T

tina

AFAIK, you'd have to run the conversion code from the AfterUpdate event of
each form control where you want to amend the data, but you can do it pretty
painlessly by copying the following line of code verbatim into the the
AfterUpdate event procedure of each control, as

Screen.ActiveControl = StrConv(Screen.ActiveControl, vbProperCase)

saves you having to specify the name of each control within its' procedure.

hth
 

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