Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo & List Index Question

Status
Not open for further replies.

savok

Technical User
Jan 11, 2001
303
AT
I have 2 Combos, the 2nd is loaded based on the selection of the first. Because of that the 2nd combo is sometimes empty and sometimes isnt. When it is not empty and has items in it, I want to get rid of the first blank item. So I set Combo.ListIndex = 0 and this works fine. But when based on the selection of the 1st combo the 2nd is empty, Combo.ListIndex = 0 gives an error since its at -1.

What Can I do to get rid of the first blank line when there are actually items in combo and do nothing when there arent.

hope this makes sense :) thanks for the help.
 
Never mind, figured it out..

If Combo.ListCount = 0 Then
Else
Combo.ListIndex = 0
End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top