How to retrieve data from unbound listbox.

  • Thread starter Thread starter cr113
  • Start date Start date
C

cr113

I'm trying to retrieve data from a multi-column, unbound listbox.

Suppose you create a simple unbound listbox with 2 columns.

Then use the following to fill the listbox:

ListBox1.AddItem("a;1")
ListBox1.AddItem("b;2")

Suppose the user highlights the second row, the one with a "b" in the
1st column. How would I retrieve the data in column 2 (in this case a
2)?
 
I'm trying to retrieve data from a multi-column, unbound listbox.

Suppose you create a simple unbound listbox with 2 columns.

Then use the following to fill the listbox:

ListBox1.AddItem("a;1")
ListBox1.AddItem("b;2")

Suppose the user highlights the second row, the one with a "b" in the
1st column. How would I retrieve the data in column 2 (in this case a
2)?

Retrieve it where? And do what with it?
As the control source of an unbound control:
=[ListBoxName].Column(1)

List boxes (and Combo Boxes) are Zero based. Column(1) is the 2nd
column.
 
I'm trying to retrieve data from a multi-column, unbound listbox.
Suppose you create a simple unbound listbox with 2 columns.
Then use the following to fill the listbox:

Suppose the user highlights the second row, the one with a "b" in the
1st column. How would I retrieve the data in column 2 (in this case a
2)?

Retrieve it where? And do what with it?
As the control source of an unbound control:
=[ListBoxName].Column(1)

That's exactly what I needed.

Thanks!
 
Back
Top