Skip to Content
Former Member
Apr 13, 2004 at 01:10 PM

UI: Clearing items from a combobox item in a matrix


How do you clear all the items out of a combo box in a matrix?

For "normal" comboboxes on a form I've been using the following code:

Set cbo = oForm.Items("cbo").Specific

If (Not cbo Is Nothing) Then

Do While cbo.ValidValues.Count > 0

Call cbo.ValidValues.Remove(0, psk_Index)


End If

But if I use the same code for a combo box in a matrix I get the following error:

Runtime Error "-10"

Am I missing something? Is there a better way of removing items from a combobox?

Thanks in advance