Using unbound columns of a list box

  • Thread starter Thread starter Rob Brookbanks
  • Start date Start date
R

Rob Brookbanks

I have the following code in a list box. Basically, it populates a text box
with a suppliers ID number and the textbox is bound to an underlying table.

Private Sub ItemsListBox_AfterUpdate()
SupplierRefBox.Value = ItemsListBox.Column(4).Value
End Sub

When it triggers, I get the following error.

Object required

What am I doing wrong?

All I really want to do is populate a bound text box with the value from my
list box

I can do it with the bound column from the list box, but not the unbound it
seems!

TIA,

Rob
 
Rob,

When you are using the Column property, the column you are referencing must be
included in the Column Count property of the listbox (same applies to
comboboxes). So since you are referencing the column index 4, you must have at
least a column count of 5. You then set the column width of the unused columns
to 0. Typically would look like: 0;2;0;0;0
 
Back
Top