Combo Boxes - Empty or Full ?

  • Thread starter Thread starter garfitz
  • Start date Start date
G

garfitz

How can I tell if a ComboBox has any items ?

I've tried the following but it does not work when the
combobox is empty as element 0 is NULL and therefore
throws a NULL reference error. Any ideas ?

If cmbVwCustomer.Items(0) = "" Then
' combo box is empty, populate
End If
 
garfitz said:
How can I tell if a ComboBox has any items ?

I've tried the following but it does not work when the
combobox is empty as element 0 is NULL and therefore
throws a NULL reference error. Any ideas ?

If cmbVwCustomer.Items(0) = "" Then
' combo box is empty, populate
End If

Use ComboBox.Items.Count perhaps?
 
Back
Top