By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,524 Members | 1,475 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,524 IT Pros & Developers. It's quick & easy.

How to return a specific combobo item?

P: n/a
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
Mar 29 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
mrmagoo wrote:
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
Mar 29 '06 #2

P: n/a
thanks!

"Chris" <no@spam.com> wrote in message
news:eN**************@TK2MSFTNGP09.phx.gbl...
mrmagoo wrote:
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

Mar 29 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.