Sentence case fields

  • Thread starter Thread starter Mike C.
  • Start date Start date
M

Mike C.

Hello.

Is there a way to set the format of a field on a form so
that it automatically sets the inputed data into "Sentence
format"?

In other words, if a users types in "johnson" it
automatically chanegs it to "Johnson"

Thanks in advance,

m.
 
Check Access VB Help on the StrConv() function used in conj. with the option
vbProperCase.
 
Hello.

Is there a way to set the format of a field on a form so
that it automatically sets the inputed data into "Sentence
format"?

In other words, if a users types in "johnson" it
automatically chanegs it to "Johnson"

Thanks in advance,

m.

Only the one word in the field?
In the AfterUpdate event of the control:
[ControlName] = StrConv([ControlName],3)

Be aware that this sometimes gives unwanted results.
McDonald, IBM, O'Brien, van den Steen become respectively Mcdonald,
Ibm, O'brien, Van Den Steen.

If by Sentence format you mean capitalize just the first word of many
in a sentence:
[ControlName] = UCase(Left([ControlName],1)) &
LCase(Mid([ControlName],2))

This also may give unintended results as
THIS IS IN REGARDS TO THE VAN GOGH IN PAINTING IN AMSTERDAM.
becomes
This is in regards to the van gogh painting in amsterdam.

Good luck.
 
Thanks alot. This will due nicely.

m.
-----Original Message-----
Hello.

Is there a way to set the format of a field on a form so
that it automatically sets the inputed data into "Sentence
format"?

In other words, if a users types in "johnson" it
automatically chanegs it to "Johnson"

Thanks in advance,

m.

Only the one word in the field?
In the AfterUpdate event of the control:
[ControlName] = StrConv([ControlName],3)

Be aware that this sometimes gives unwanted results.
McDonald, IBM, O'Brien, van den Steen become respectively Mcdonald,
Ibm, O'brien, Van Den Steen.

If by Sentence format you mean capitalize just the first word of many
in a sentence:
[ControlName] = UCase(Left([ControlName],1)) &
LCase(Mid([ControlName],2))

This also may give unintended results as
THIS IS IN REGARDS TO THE VAN GOGH IN PAINTING IN AMSTERDAM.
becomes
This is in regards to the van gogh painting in amsterdam.

Good luck.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.
 
Back
Top