Easy question, but having a hard time to figure it out

SD23

Registered User.
Local time
Today, 06:19
Joined
Jun 13, 2006
Messages
60
I have a form with a pull down box which has a list of about 50 names. The last names are capatilized and the first names have the first letter capitalized and the rest lower case. For example,

SMITH, John
DOE, Sam

The user can input their own name if it is not included in the pull down menu.
The name field is all one field. The first and last name are entered in one text box and are seperated by a comma.
Is there a way to capitalize the last name and lower case the first name if they are inputed in one text field and seperated by a comma? I appreciate the help.


For example

If the user enters: smith, john

The database through some code will change it to: SMITH, John

Again, I would appreciate some help. I am pretty new at VB. Thank you.
 
Private Sub txtUserName_Exit(Cancel As Integer)

txtUserName = StrConv(Left(txtUserName, InStr(1, txtUserName, ",")), vbUpperCase) & StrConv(Mid(txtUserName, InStr(1, txtUserName, ",") + 1), vbProperCase)

End Sub
 
Thank you.
 

Users who are viewing this thread

Back
Top Bottom