How to return a specific combobo item?

  • Thread starter Thread starter mrmagoo
  • Start date Start date
M

mrmagoo

How do I stick an list item from a combobox into the text property of it?
Let's say I want the first item in the combobox list to display.

With cbo
If .Items.Count = 1 then
' Display that item in the combo
.Text = <THAT ITEM> ?
end if
end with

This works, but surely there must be an easier way?

With cbo
If .Items.Count = 1 Then
For Each o In .Items
.Text = o.PropValue
Next
End If
End With

thx
 
mrmagoo said:
How do I stick an list item from a combobox into the text property of it?
Let's say I want the first item in the combobox list to display.

With cbo
If .Items.Count = 1 then
' Display that item in the combo
.Text = <THAT ITEM> ?
end if
end with

This works, but surely there must be an easier way?

With cbo
If .Items.Count = 1 Then
For Each o In .Items
.Text = o.PropValue
Next
End If
End With

thx


With cbo
If .Items.Count = 1 then
' Display that item in the combo
.SelectedIndex = 0
end if
end with

Chris
 
Back
Top