NJCorp
Цитата:
Код: Private Sub TextBox1_AfterUpdate()
Dim aText() As String, strText As String, i As Byte
strText = Trim(TextBox1.Text)
Do While InStr(1, strText, " ") > 0
strText = Replace(strText, " ", " ")
Loop
aText = Split(strText)
For i = 0 To UBound(aText)
aText(i) = UCase(Left(aText(i), 1)) & _
LCase(Right(aText(i), Len(aText(i)) - 1))
Next i
Me.TextBox1 = Join(aText)
End Sub
Цитата:
Подскажите плз кодик для написания Фамилии Имени и По-батюшки с большой букви.
Ето один текстбокс. Ну и запрет двойного пробела.
Код: Private Sub TextBox1_AfterUpdate()
Dim aText() As String, strText As String, i As Byte
strText = Trim(TextBox1.Text)
Do While InStr(1, strText, " ") > 0
strText = Replace(strText, " ", " ")
Loop
aText = Split(strText)
For i = 0 To UBound(aText)
aText(i) = UCase(Left(aText(i), 1)) & _
LCase(Right(aText(i), Len(aText(i)) - 1))
Next i
Me.TextBox1 = Join(aText)
End Sub