Input Mask - Capitalise First Letter ?

A

andyw

Hi,

I wish to have an input mask which capitalises the first letter of word
of unknown length ?

Is this possible, so far I've only managed to do this if I specify a
certain amount of lowercase letters ?
 
J

John Vinson

Hi,

I wish to have an input mask which capitalises the first letter of word
of unknown length ?

Is this possible, so far I've only managed to do this if I specify a
certain amount of lowercase letters ?

Input masks are not capable of doing this. They are simply not a very
capable tool for anything other than limiting allowed data entry!

You can use a bit of VBA code on a Form to force this conversion: use
the AfterUpdate event of the textbox into which the data is entered.

Private Sub textboxname_AfterUpdate()
Me!textboxname = UCase(Left(Me![textboxname], 1) & _
LCase(Mid(Me!textboxname], 2)
End Sub

If this if for names, not that there are names with valid mixed
capitalization such as "de la Renta" and "MacKeith".

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
F

fredg

Hi,

I wish to have an input mask which capitalises the first letter of word
of unknown length ?

Is this possible, so far I've only managed to do this if I specify a
certain amount of lowercase letters ?

Don's use a mask.
Code the Control's AfterUpdate event:

[ControlName] = UCase(Left([ControlName],1)) & Mid([ControlName],2)
 

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