Need string for capitalization

  • Thread starter Thread starter Kathy MacAthur
  • Start date Start date
K

Kathy MacAthur

Hope someone can help.

I'm trying to capitalize the first letter of a field but the string I am
using capitalizes the first letter, but changes the second and third
characters and UN capitalizes them. (Example, Oregon. If someone correctly
enters OR for state name it is changed to Or.) I need a string that will
only capitalized the first letter and leave the remaining characters as
entered.

The string I'm using is StrConv([fieldname],3)

Any suggestions?

Thanks,

Kathy
 
Hope someone can help.

I'm trying to capitalize the first letter of a field but the string I am
using capitalizes the first letter, but changes the second and third
characters and UN capitalizes them. (Example, Oregon. If someone correctly
enters OR for state name it is changed to Or.) I need a string that will
only capitalized the first letter and leave the remaining characters as
entered.

The string I'm using is StrConv([fieldname],3)

Any suggestions?

Thanks,

Kathy

Kathy,
That is the correct behavior of StrConv([FieldName],3)

In a Form, on a Report, in a Query?

Code theAfterUpdate event of the control on the form:
[ControlName] = UCase(Left([ControlName],1)) & Mid([ControlName],2)

In a report control Source:
= UCase(Left([ControlName],1)) & Mid([ControlName],2)

In a Query:
Exp: UCase(Left([ControlName],1)) & Mid([ControlName],2)

Only the first character in the field will be Upper Case.
 
Mid(YourString,1,1)=Ucase(Left(YourString,1)

Alex.

fredg said:
Hope someone can help.

I'm trying to capitalize the first letter of a field but the string I am
using capitalizes the first letter, but changes the second and third
characters and UN capitalizes them. (Example, Oregon. If someone correctly
enters OR for state name it is changed to Or.) I need a string that will
only capitalized the first letter and leave the remaining characters as
entered.

The string I'm using is StrConv([fieldname],3)

Any suggestions?

Thanks,

Kathy

Kathy,
That is the correct behavior of StrConv([FieldName],3)

In a Form, on a Report, in a Query?

Code theAfterUpdate event of the control on the form:
[ControlName] = UCase(Left([ControlName],1)) & Mid([ControlName],2)

In a report control Source:
= UCase(Left([ControlName],1)) & Mid([ControlName],2)

In a Query:
Exp: UCase(Left([ControlName],1)) & Mid([ControlName],2)

Only the first character in the field will be Upper Case.
 
This is why I look through the newsgroups. I have been
using Access for 7 years. Add in some VB, ASP, VB.NET,
ColdFusion, JavaScript, Flash, Oracle, SQL Server, etc.
and I've been programming full time the entire 7 years.

I have NEVER thought of using the MID function on the left
of the = sign. I even went and tested this, and it
works.

Thanks for the tip.


Chris
 
Well, sometimes I find a perl in sand of these newsgroups too and I'm sure
many others
could tell you the same. Thanks for the comment.

Alex.
 
Back
Top