How to get the value at the second column of the ComboBox?

  • Thread starter Thread starter mezzanine1974
  • Start date Start date
M

mezzanine1974

I have a ComboBox1 which has two column and the first columns is
bounded. Simply like that:

Supplier-ID Supplier Name
124556 Microsoft
236541 Apple

"Me.ComboBox1.Value" refers to Supplier-ID because it is bounded
column.
What kind of VBA statement can provide me the value of the second
column which is not bounded (Supplier Name)?
Is It possible?
 
Me.ComboBox1.Column(1)

Column is a zero-based property, so the first column is zero, the second
column is one, etc.
 
Thank you.. !
it is similar to Me.ComboBox1.ItemData(0). It returns the row values
instead.
 
ItemData returns the value of the Bound Column's data for a given row -- and
yes, it's also zero-based.
 
Also, you can use the Column property to get the value in any column in any
row, regardless of which "row" is currently selected in the combobox.

Me.ComboBox.Column(ColumnNumber_ZeroBased, RowNumber_ZeroBased)

Works for listboxes too.
 
Back
Top