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

Settting a value in combobox

Status
Not open for further replies.

huBBLe

Programmer
May 15, 2001
50
SG
Hi,

how do you set a value for a combobox at runtime?

For example, I already have a ComboBox with 2 items "Correct" and "Wrong":

Dim Value As String

Value = "Correct"

Select Case Value
Case "Correct"
'sentence to select the value
Case "Wrong"
''sentence to select the value
End Select
 
Dim Value As String

Value = "Correct"

Select Case Value
Case "Correct"
'sentence to select the value
Combo1.ListIndex = 0 'this assumes you know the order of the values in the list
Case "Wrong"
''sentence to select the value
Combo1.ListIndex = 1
End Select Tim

Remember the KISS principle:
Keep It Simple, Stupid!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top