Need string for capitalization

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
 
F

fredg

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.
 
A

Alex Ivanov

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.
 
C

Chris

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
 
A

Alex Ivanov

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.
 
G

Guest

thank you for all of u guys I realy learn a lot from this site!!! mid with string !!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top