Sentence first letter convert to capital letter?

smile

Registered User.
Local time
Today, 15:11
Joined
Apr 21, 2006
Messages
212
How can I convert a sentece in my report that it would start with the capital letter?

I have: du simtai Lt, 0 ct.

I need: Du simtai Lt, 0 ct.

I tried to use strconv but that makes every word first letter capital.
 
Hello:

One way would be to extract the first letter of this string using the LEFT$ function and then capitalize this character and then add it back to the rest of the string.

Regards
Mark
 
Hello:

One way would be to extract the first letter of this string using the LEFT$ function and then capitalize this character and then add it back to the rest of the string.

Regards
Mark

Could you post an example? Do I need to do this in the report or a separate module?
 
I inluded a textbox and placed the code bellow in it:
=UCase(Left$([words];1)) & LCase(Mid$([words];2))

words is another text box in my report that need to convert.
I hidden the first textbox and now it works fine :)

Thanks, if somebody can provide a better solution that would be welcome
 
have you tried something like this?
strString = StrConv(strString, vbProperCase)
 
too late!! haha no just kidding


you can put it in the before update event of the txtbox that you want converted

youll have to adjust it to fit your needs obviously
 
too late!! haha no just kidding


you can put it in the before update event of the txtbox that you want converted

youll have to adjust it to fit your needs obviously

On a report page there is no before update event :confused:
 
On a report page there is no before update event :confused:

right but if you convert it before you save it, you wont have to go back and convert it before you print it on a report, you can just call it from the table
 
right but if you convert it before you save it, you wont have to go back and convert it before you print it on a report, you can just call it from the table

The words I need to convert do not exist on any table :(

I have a query that takes data (number) from a table then uses module with script to convert the (number) to (words). Then a report is made from that query. I have tried various functions but I get error circular reference.

I wan't to do as less editing as possible or no at all to the reports I mean, or editing that would not include to copy and hide txtboxes etc.
 
Why not just add the conversion to the module that converts the number to words?
 
Why not just add the conversion to the module that converts the number to words?

I would do that if I knew how, I can send you the code.
Send me PM with an email adress where can I send the code and I will email you the code. Thanks.
 
Okay, the result is this, which is added just before the End Function in the ConvertCurrencyToEnglish Function:
Code:
ConvertCurrencyToEnglish = UCase(Left$(ConvertCurrencyToEnglish;1)) & Mid$(ConvertCurrencyToEnglish;2)
 
Okay, the result is this, which is added just before the End Function in the ConvertCurrencyToEnglish Function:
Code:
ConvertCurrencyToEnglish = UCase(Left$(ConvertCurrencyToEnglish;1)) & Mid$(ConvertCurrencyToEnglish;2)

That was fast :)
I needed to change the code to make it work why:
Code:
ConvertCurrencyToEnglish = UCase(Left$(ConvertCurrencyToEnglish, 1)) & Mid$(ConvertCurrencyToEnglish, 2)
 
I was using semi-colons because I thought that might be needed for your regional version (since you had posted that earlier). But, if you got it to work with commas (which is what I'm used to using), then that is great.
 
I was using semi-colons because I thought that might be needed for your regional version (since you had posted that earlier). But, if you got it to work with commas (which is what I'm used to using), then that is great.

Thanks for the fix, I wanted to add you some points but got his error:You must spread some Reputation around before giving it to boblarson again.
 
Thanks for the fix, I wanted to add you some point but got his error:You must spread some Reputation around before giving it to boblarson again.

No problem - it is a feature to keep people from being able to pile it on (or give negative rep) to one person. So, you have to give reputation to many others before being able to give it to the same person again.

It's not a problem, but I appreciate the thought. :)
 

Users who are viewing this thread

Back
Top Bottom