si************@gmail.com wrote:
Is there a simple way to capatalise the first letter of every word
typed into a textbox on a form. Someone told me to use "Proper" but not
sure if this is correct or how and where to use it.
Please can someone help.
Many thanks in advance!
In your AfterUpdate event for the textbox you can use StrConv(). Ex:
Me.Text0 = StrConv(Me.Text0,vbProperCase)
There may be times that one would want to have upper case. Ex: ABC
Company. You could create a global variable for the form under the
Option Explicit/Option Compare statements.
Dim blnCompany As Boolean
and in the OnCurrent event enter something like
blnCompany = False
and in the AfterUpdate event enter
If Me.NewRecord And Not blnCompany Then
'proper case it only at 1st time of entry
'if this is a new record. If editting an existing
'record, let the op enter whatever
Me.Text0 = StrConv(Me.Text0,vbProperCase)
End If
blnCompany = True
so that the first time the value is entered it will change the value to
a proper case if required but it can be overwritten later on.