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

ComboBoxData, change Capital to non-Capital 3

Status
Not open for further replies.

HydraNL

Technical User
May 9, 2005
74
0
0
NL
Hi,

How do I change the text in the ComboBox from Capital to non-capital?

The ComboBox is filled on Form_Load()

Do Until rs.EOF
Combo1.AddItem rs!TEST
rs.MoveNext
Loop

Greetings J. Radjesh Klauke (Netherlands)
 
Look into the LCase() and UCase() functions.
Code:
...
Combo1.AddItem LCase(rs!TEST)
...

zemp
 
You could use the LCase function

Code:
Do Until rs.EOF
   Combo1.AddItem lcase(rs!TEST)
   rs.MoveNext
Loop
 
Thanks guys. Works fine.

One question remains. How do I make onlythe first letter Capital and the rest LCase?

Greetings J. Radjesh Klauke (Netherlands)
 
Code:
Combo1.AddItem UCase(Left(rs!TEST, 1)) & LCase(Right(rs!TEXT, Len(rs!TEXT)-1))

Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Tracy,

An easier way to convert to Proper case would be to use:
Code:
Combo1.AddItem StrConv(rs!TEST, vbProperCase)
Cheers

HarleyQuinn
---------------------------------
Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
The code of HarleyQuinn works fast. But both of you deserve a shiny. Thank you both for the effort.

Greetings J. Radjesh Klauke (Netherlands)
 
You're welcome, thanks for the star [smile]

HarleyQuinn
---------------------------------
Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
HydraNL: Thanks for the star!

HarleyQuinn: I'd completely forgotten about strConv! Thanks for reminding me!


Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top