The StrConv function can be used to change the case of a string to uppercase, lowercase, or so that the first letter is uppercase. The syntax is StrConv(string, conversion), where "string" is the text string and "conversion" is 1, 2, or 3. For "conversion," uppercase is 1, lowercase is 2, and 3 makes the first letter of each word uppercase. Instead of the integers 1, 2, or 3, you can also use one of the following constants:
vbUpperCase - Converts the entire string to uppercase.
vbLowerCase - Converts the entire string to lowercase.
vbProperCase - Converts the first letter of each word to uppercase and the remaining letters to lowercase.
For example:
Code:
Private Sub LastName_AfterUpdate()
LastName = StrConv(LastName, vbProperCase)
End Sub
The above code converts the Last name with first letter as capital and the rest in lower case.
Bookmarks