Easy Question, but not sure how to do it. (1 Viewer)

SD23

Registered User.
Local time
Yesterday, 21:37
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. I was wondering if there is a way for the database to put the users name in the same format. For example

If the user enters: smith, john

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

I would appreciate some help. I am pretty new at VB. Thank you.
 

DocNice

Registered User.
Local time
Yesterday, 21:37
Joined
Oct 6, 2004
Messages
76
Try this:

Dim strLastName, strFirstName
strLastName = UCase[Last Name Field] ' String to convert.
strFirstName = LCase[First Name Field]
 

SD23

Registered User.
Local time
Yesterday, 21:37
Joined
Jun 13, 2006
Messages
60
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.
 

DocNice

Registered User.
Local time
Yesterday, 21:37
Joined
Oct 6, 2004
Messages
76
It can be done, but it's starting to get pretty complicated. Is it pretty hard for you to split that field into two fields?

If not, you can modify the string different ways. I'd personally have to search in the Access help files to remember them.
 

Users who are viewing this thread

Top Bottom