Re: Input mask problem
- From: John Vinson <jvinson@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 06 Jul 2005 14:43:58 -0600
On Wed, 6 Jul 2005 20:11:54 +0100, "Jack Isaacs"
<jack@xxxxxxxxxxxxxxxx> wrote:
>Hello All
>I'm sure this should be simple but I can't seem to get it. I need an input
>mask to make it so that the first character of each word entered in a text
>box is capitalised, and the rest are lower-case. All characters will be
>alpha-numeric, and there will be anything from 1 to 4 'names' - i.e. up to 3
>spaces. So the very first character needs to be capitalised, then the first
>character after a space needs to be capitalised.
>I would be very grateful for any help.
>Many thanks
>Les
>
Input masks have very limited capabilities; this is not amongst them.
You simply cannot do this with an Input Mask.
What you can do is to put VBA code in the textbox's AfterUpdate event,
using the StrConv() function to translate the user's input into Proper
Case (Each Word Capitalized):
Private Sub txtName_AfterUpdate()
' Only convert fields that are not already mixed case
' This will leave correct but not "proper" names such as
' MacDonald, van der Steen, and de Vargas undamaged
If StrComp(Me!txtName, LCase(Me!txtName), 0) = 0 Then
Me!txtName = StrConv(Me!txtName, vbProperCase)
End If
End Sub
John W. Vinson[MVP]
.
- Follow-Ups:
- Re: Input mask problem
- From: Leslie Isaacs
- Re: Input mask problem
- References:
- Input mask problem
- From: Jack Isaacs
- Input mask problem
- Prev by Date: Copying a form; best way(s)
- Next by Date: Re: Copying a form; best way(s)
- Previous by thread: Input mask problem
- Next by thread: Re: Input mask problem
- Index(es):
Relevant Pages
|