judgehopkins
Technical User
This code below strips all leading and following spaces from a string and also “proper cases” that string.
I have two questions:
(1) How can I make this procedure work on all the text box controls in the form?
and
(2) How can I strip unwanted spaces from inside the string, e.g., changing “John son” to “Johnson”?
Thanks!
judgehopkins@yahoo.com
I have two questions:
(1) How can I make this procedure work on all the text box controls in the form?
and
(2) How can I strip unwanted spaces from inside the string, e.g., changing “John son” to “Johnson”?
Code:
'Private Sub Form_Current_AfterUpdate()
Private Sub BuyerOwnerFirstName_AfterUpdate()
Me.BuyerOwnerFirstName = Trim([BuyerOwnerFirstName])
'trims all spaces from entry into control
Me.BuyerOwnerFirstName = StrConv([BuyerOwnerFirstName], vbProperCase)
'capitalizes first letter of entry
End Sub
Thanks!
judgehopkins@yahoo.com