retrieve

G

Guest

Great admirer of this site:
I built a multi listbox that has many columns. I am trying to use the
column(x)
property to pick up the additional values in each selected row. The
Ctl.Itemdata(varitm) correctly displays each selected item, but I am not able
to correctly pick up the various columns if more than one row is selected.
My Debug.Print ctl.Column(1) does not change after the first item.
I made a test db to validate this.
Thanks in advance for the help.
also open to any other suggestions on picking up this information
Thanks
Steve

Dim ctl As Control
Dim frm
Dim varItm As Variant
Set frm = Forms!form1
Set ctl = frm!List0
For Each varItm In ctl.ItemsSelected
MsgBox ctl.ItemData(varItm)
Debug.Print ctl.Column(1)
Next varItm
 
G

Graham Mandeno

Hi Steve

varItm will be the row index for the current selected row in your loop, so
you can say:
Debug.Print ctl.Column(1, varItm), ctl.Column(2, varItm)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top