Combobox Item Number

  • Thread starter Thread starter Todd Huttenstine
  • Start date Start date
T

Todd Huttenstine

Lets say there are 20 items that can possible be chosen
out of a combobox. Lets say I selected the
value "April". The value April is the 4th item in the
combobox. What is the code that will return 4? I just
need a code that will return the location number of the
value that I selected.


Thank you
Todd Huttenstine
 
ComboBox1.ListIndex + 1

(The index is zero-based, so the first item has a ListIndex of 0).
 
Hi Todd

Combo1.ListIndex + 1

(since item 1 is listindex 0 )

HTH. Best wishes Harald
 
Hah ... beat you to it!

I must be feeling better ... :)

Regards,

Vasant.
 
If you mean VB, you can use the listindex

i = Combo1.Listindex

One thing to note is that the listindex property is zero based, so i
you are looking for the fourth item in the list, it will have
listindex of 3.

Also, to get the value for an item where you know the listindex, yo
would use:

strValue = Combo1.List(1)

Which would retrieve the second value in your list.

K

Edit: Way too slow I see..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top