This would converts all initial letters to upper case .For example this string "visual basic" turns into "Visual Basic"
Printable View
This would converts all initial letters to upper case .For example this string "visual basic" turns into "Visual Basic"
This is a bit shorter and does the same:
VB Code:
Public Function UpAllWords(ByVal TEXTIN As String) As String UpAllWords = StrConv(TEXTIN, vbProperCase) End Function
:) Cool.
I am posting this here because it relates to converting all letters to uppercase. (Saves double posting)
In this example if the character is a-z it converts it to uppercase.
The line KeyAscii = Asc(UCase(Chr(KeyAscii))) will accept numbers without modifying them.
this works for any function that has the ascii value passed as a parameter.Code:Private Sub text1_KeyPress(KeyAscii As Integer)
MsgBox KeyAscii
If KeyAscii >= 97 And KeyAscii <= 122 Then
KeyAscii = Asc(UCase(Chr(KeyAscii)))
Else
KeyAscii = 0
End If
End Sub
This code is part of a thread I started a while back, Hack came up with the solution. Credit goes to him.