I need to code vbProperCase

E

edward keith

I would like the firest letter of all my fields to be uppercase. I can't
seem to get it to work. Can you help Please with code? Thanks, Edward Keith
 
A

Allen Browne

Use the AfterUpdate event procedure of the field to change it's value.

Example:
Private Sub Text0_AfterUpdate()
Me.Text0 = StrConv(Me.Text0, vbProperCase)
End Sub

In general, this doesn't work very well. It upsets the McDonalds, O'Briens,
van Leens, etc.
 
T

tina

in addition to Allen's information and code, note that vbProperCase will
capitalize the first letter of each separate *word* in a field. capitalizing
only the first letter in a *field* might be closer to "Sentence" case, which
is available in MS Word but not in Access.

hth


edward keith said:
I would like the firest letter of all my fields to be uppercase. I can't
seem to get it to work. Can you help Please with code? Thanks, Edward
Keith
 
G

Graham Mandeno

tina said:
in addition to Allen's information and code, note that vbProperCase will
capitalize the first letter of each separate *word* in a field.
capitalizing
only the first letter in a *field* might be closer to "Sentence" case,
which
is available in MS Word but not in Access.

.... but it's still easy enough to do. Simply uppercase the first letter and
lowercase the rest:

UCase(Left([MyField], 1)) & LCase(Mid([MyField], 2))
 
Top