>I have a combo on a form with the style set to 2-Dropdown list. I populate the list through code based on a choice in another combo.
>
>I set the combo to the first item in the list after it is populated with cbo.text = cbo.list(0). Works fine except if the list is empty.
>
>How can I tell if it's empty? I tried .listcount but it has a value of 1 if it's empty or has been populated with only 1 item.
You should use:
if cbo.listcount > 0 then cbo.text = cbo.list(0)
I made some test and listcount is giving me 0 if there is nothing in the list (VB6 SP4).
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com