Autoselecting the First item in a combo-box

I am sure this has been answered before, but I don't feel like searching through 5000 questions.  How do you autoselect the first item in a drop-down combo box.  I have added all of the items in there, but I want the first item to be pre-selected.
dt19643063098Asked:
Who is Participating?
 
clifABBConnect With a Mentor Commented:
Combo1.ListIndex = 0
0
 
clifABBCommented:
Now that I've locked in the answer, to avoid errors in case the list is empty, you should use this code:
If Combo1.ListCount > 0 Then
  Combo1.ListIndex = 0
Else
  Combo1.ListIndex = -1
End If
0
 
dt19643063098Author Commented:
That doesn't allow me to select anything, it autoselects it and then invokes the click event.  I mis-worded the question.  I want the first item to appear, but not be pre-selected.
0
 
clifABBCommented:
Oh, in that case:
Combo1.Text = Combo1.List(0)
(use the error avoiding code above)

0
 
dt19643063098Author Commented:
Thanks for the help.  If your familiar with Crystal Reports, you might want to look at the other question I submitted.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.