F
Faz
how do i type sentences and have each word start with uppercase?
You may usehow do i type sentences and have each word start with uppercase?
Stefan Hoffmann said:hi,
You may usehow do i type sentences and have each word start with uppercase?
Function StrConv(String, Conversion As VbStrConv, [LocaleID As Long])
with Conversion := vbProperCase
But it's not aware of some special cases like O'Brain, will be convertet
to O'brain.
mfG
--> stefan <--
TryHi Stefan, thank you. I am new to VB and i will really appreciate your help.
The name of my text box is "sentence" I did the following and it does not do
anything. Can you please write the exact code i should be using.
Private Sub String_BeforeUpdate(Cancel As Integer)
Dim sentence As String
sentence = StrConv(sentence, vbProperCase, 3)
End Sub
Hi Stefan, thank you. I am new to VB and i will really appreciate your help.
The name of my text box is "sentence" I did the following and it does not do
anything. Can you please write the exact code i should be using.
Private Sub String_BeforeUpdate(Cancel As Integer)
Dim sentence As String
sentence = StrConv(sentence, vbProperCase, 3)
End Sub
Thanks
Faz
Stefan Hoffmann said:hi,
You may usehow do i type sentences and have each word start with uppercase?
Function StrConv(String, Conversion As VbStrConv, [LocaleID As Long])
with Conversion := vbProperCase
But it's not aware of some special cases like O'Brain, will be convertet
to O'brain.
mfG
--> stefan <--
fredg said:Hi Stefan, thank you. I am new to VB and i will really appreciate your help.
The name of my text box is "sentence" I did the following and it does not do
anything. Can you please write the exact code i should be using.
Private Sub String_BeforeUpdate(Cancel As Integer)
Dim sentence As String
sentence = StrConv(sentence, vbProperCase, 3)
End Sub
Thanks
Faz
Stefan Hoffmann said:hi,
Faz wrote:
how do i type sentences and have each word start with uppercase?
You may use
Function StrConv(String, Conversion As VbStrConv, [LocaleID As Long])
with Conversion := vbProperCase
But it's not aware of some special cases like O'Brain, will be convertet
to O'brain.
mfG
--> stefan <--
Use the control's AfterUpdate event, not the BeforeUpdate event.
Private Sub Sentence_AfterUpdate()
[Sentence] = StrConv([Sentence],3)
End Sub
Note: the above will capitalize the first letter of every word in the
field. It will also change each additional character in the word to
lower case, which in some instances may not be correct.
IBM will be changed to Ibm. McDonald to Mcdonald, O'Brien to O'brien
etc., and some names will be incorrectly capitalized: van der Meer
will become Van Der Meer, etc.