Capitalise first letter of words automatically

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Had this set up before, had a crash, cannot for the life of me remember how do to it

Any ideas people

Regard

Perry Kerr
 
I assume you're looking for code to do this...
StrConv is the function that does this
Syntax is
mystr = strconv(string, conversion)
for your case
myStr = StrCov("hello there", vbProperCase)
 
Thanks - the minute I saw the code I remembered

Just as an after thought, is there anyway to apply this globally to a form with losts of fields

Perry Kerr
 
yes, but if the users don't need to see the "fixed" fields right away it's
easier to do it on the form_afterupdate event
ie
Dim C as Access.Control
For Each C In Me.Controls
If TypeOf C is TextBox Then
C.Value = strConv(C.Value, vbProperCase) ' nothing bad will happen to
numbers ie - so..
end if
next
 
Back
Top