Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formating name on report 1

Status
Not open for further replies.

RnRExpress

Technical User
Oct 24, 2004
53
US
One other thing I am trying to do, is when I run a report which includes a first name of someone from a record, I would like the report to autmatically format it so the first letter is capitalzed, but the rest isn't. I also would like to add a comman "," at the end of the name.

I know this may seem a simple thing to everyone, but I sure could use a hand on this.

Thanks again in advance!

Richard
 
Oh, some additional info. In the form itself, I have the format set to >, so everything on the form is capitalzed.

But when I run a report (which I have set up as a letter and am using the first name as a salutation), I would like only the 1st letter capitalized. Then a "," at the end of the name.

Sorry my first post wasn't as clear as it should have been.

Richard
 
see this: faq181-790

you can use StrConv to change the first name to Proper Case.

If the raw data is a first and last name, you can parse out the first name using by using INSTR() function to find the first space, the Left() to get the letters to the left of that.

To add a comma (or anything else) after that, use the ampersand like this:
Code:
 = Blah & ","

hope this helps!
 
The first name is in a text field all by itself. I just want the First letter capitalized and the rest lower cae.
 
What about this ?
StrConv(Trim([First Name]), vbProperCase) & ","

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
PHV,

Now it prompts me for the Customer Last Name when I place that code into the text box.

Guess this just isn't my day doing this stuff <G>

Richard
 
Ok, I gave it one last shot. I checked out a couple of FAQ's and here is what I tried. See if you guys can see anything wrong here.

On my report, I added the field "Customer First Name" and made it noon-visible. I then added a unbound text box, labeled Text25, and then added this for the control:

=StrConv([Customer First Name],[vbProperCase])

Now, when I run it, the report prompts me to enter [vbProperCase].

So, can anyone point out what I am doing wrong :)

Richard
 
=StrConv([Customer First Name],vbProperCase)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
PHV,

I tried to remove those brackets around vbProperCase, but after I click OK to save the expression, the program automatically puts the brackets back in. I can't get rid of them.


I copied and pasted exactly what you had above, and Access is putting those [] back in so no matter what, I end up with:

=StrConv([Customer First Name],[vbProperCase])

Richard
 
=StrConv([Customer First Name], 3)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
PHV,

Dont know why, but that last one worked like a charm.

mucho appreciato!!

Richard
 
I guess when I originally suggested that you look up info on StrConv, I was hoping to teach you to fish. Sometimes poking around in HELP and other forums teaches us a lot more than just getting the answer.

g
 
Ginger,

I can appreciate that. I even have a Intro to Access book. I did eventually find the info, but as you saw above, no matter what I put in, I always got the error until PHV told me to use the "3" instead of vbProperCase.

Luckily, there are forums like this, when you have tried and could not find the answer to the problem.

Thanks :)

Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top