-
1
- #1
Hello
I'm new to vba and would appreciate some help with the following prob: I have a text field in a form, and I want to ensure that the each word in the field begins with a capital letter and the rest is lower case.
This is the code I have so far, I'd really appreciate suggestions J
Private Sub txtAddress1_AfterUpdate()
'address shows first letter of each word with a capital the rest in lower case
Dim spaceposition As Integer
Dim addresspart As Integer
Dim Secondletter As Integer
spaceposition = InStr(1, Me.txtAddress1, " "
addresspart = Right(Me.txtAddress1, Len(Me.txtAddress1) - spaceposition)
Secondletter = Len(addresspart) - 1
Me.txtAddress1.Value = LCase(Me.txtAddress1.Value)
Me.txtAddress1.Value = UCase(Left(Secondletter, 1))
End Sub
I'm new to vba and would appreciate some help with the following prob: I have a text field in a form, and I want to ensure that the each word in the field begins with a capital letter and the rest is lower case.
This is the code I have so far, I'd really appreciate suggestions J
Private Sub txtAddress1_AfterUpdate()
'address shows first letter of each word with a capital the rest in lower case
Dim spaceposition As Integer
Dim addresspart As Integer
Dim Secondletter As Integer
spaceposition = InStr(1, Me.txtAddress1, " "
addresspart = Right(Me.txtAddress1, Len(Me.txtAddress1) - spaceposition)
Secondletter = Len(addresspart) - 1
Me.txtAddress1.Value = LCase(Me.txtAddress1.Value)
Me.txtAddress1.Value = UCase(Left(Secondletter, 1))
End Sub