Input Masks (Last names!!)

mateogp

Registered User.
Local time
Today, 13:35
Joined
Aug 11, 2004
Messages
43
Hey all,

I had a question about input masks. The boss wanted all the fields to automatically capitalize names and last name. Did that, was happy for awhile. What we didnt realize is that there are names like DiGianno or McDonald that still need caps in certain spots.

The original input mask went like this: >?<CCCCCCCCCCCCCCCCCCCCCCCCC;;
This mask would caps the first letter and lowercase the rest.
What i need it to to is CAPS the first but leave whatever may follow up to the user..

In other words.... The first letter is always caps, the rest that follow is up to the user, upper or lower.


Is there any way to do this? Couldnt figure out a solution! :(



Any help would be appreciated

Mateo
 
Aternatively, build/develop and continuouysly monitor/update a table with all such names and check input after your UCase function use.

This is a universal problem.

Allowing/Expecting users to do correct things will result in unanticipated/unwanted results.
 
Input Mask

Instead of using a mask, which is not very user friendly, you can do this.
Put the following code in the After Update Event of the field:

Dim t_Lastname As String
t_Lastname = UCase(Left([Lastname], 1)) & Mid([Lastname], 2, 40)
Me.Lastname = t_Lastname

After the field is updated the first character automatically will be capital

Replace 'Lastname' with the actual fieldname and '40' with the actual lenght
of the field.

Good Luck.
 
Thanks for your help! Much appreciated.


Mateo
 

Users who are viewing this thread

Back
Top Bottom