Data entry Validation

otis1969

Registered User.
Local time
Today, 12:15
Joined
Mar 13, 2003
Messages
42
I have looked almost everywhere on input masks for this one, but my access book doesnt tell me much on the subject.

I have a textbox that names get entered into. I would like the first letter to be uppercase, regardless of the user entering it uppercase or not. Is there anyway this can be achieved?
 
On your textbox, select its properties.

Find it's AfterUpdate event and click on the button with three dots and select the code builder

Put in either of these lines:

Me.txtYourTextbox = UCase(Left(Me.txtYourTextBox, 1)) & LCase(Mid(Me.txtYourTextBox, 2))

Me.txtYourTextBox = StrConv(Me.txtYourTextBox, vbProperCase)


The first line will ensure only the first letter is upper case while every other character is lower case

The second line will ensure that every word entered will begin with a capital and every subsequent letter in each word will be in lower case.

e.g.

Case #1 - You type in "john smith" - it returns "John smith"

Case #2 - You type in "john smith" - it returns "John Smith"

The choice is yours...
 
Thank you!!
 

Users who are viewing this thread

Back
Top Bottom