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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change a ltr to upper case after a dash

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have a query that lists all the hotels that have a - (dash) and would like to change the letter after the dash to
upper case like: Ritz-carlton to Ritz-Carlton. I can find the position with the instr() comannd but I am stuck.
anyone can give a hand writting this code.

Thanks

Chapulin
 
Chapulin,

Boy, I hope there's an easier way, but the following code on a command button took the text from Text12 ("Ritz-carlton") and displayed it in Text11 as "Ritz-Carlton".

Code:
Text11 = Left(Text12, InStr(Text12, "-")) & Format(Mid(Text12, InStr(Text12, "-") + 1, 1), ">") & Mid(Text12, InStr(Text12, "-") + 2)

I wrote it out as one line because pasting line breaks in these posts gets pretty confusing.

If this ends up the way you have to go, I hope you're able to use it in an Update query and be done with it.


HTH

John

Use what you have,
Learn what you can,
Create what you need.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top