..ListCount
- Count of records in combo box
..ListIndex
- Index of selected record, where it starts at 0. If this is '-1' then no
record has been selected
..Text
- Text of selected record
..ItemData(.ListIndex)
- Basically the same as .Text, but you can supply the list number... NOTE:
the index number must be between 0 and ListCount minus one...
Eg:
If myCombo.ListIndex = -1 Then
MsgBox "Please select a value"
Else
MsgBox "Using Item Data: " & myCombo.ItemData(myCombo.ListIndex)
MsgBox "Same as Text: " & myCombo.Text
End If
"Georges Heinesch" <vo**@void.com> wrote in message
news:40********@news.vo.lu...
This works. Thanks a lot.
Is it also possible to ask which of the items is presently selected.
This would be the counterpart of teh method ItemData(), which sets the
item.
TIA
Georges
--
Ruskin wrote: Check out the properties and methods of the combo box control...
Specifically, the 'ListCount' property...
"Georges Heinesch" <vo**@void.com> wrote in message
news:40********@news.vo.lu...
Hi.
I have a combobox with a value list of 4 items. My code needs to know
the number of items in that combobox.
How can I use VBA to get the number of items in a combobox?
TIA
--
Georges