adding columns in Listbox

how do I populate two columns in the Listview with Staff Numbers and StaffNames
LVL 3
PierreBeukesAsked:
Who is Participating?
 
mcgantsCommented:
A list box doesn't have two columns, but you could add two columns from a dataset as one list item as follows:

Dim myitem As ListItem

myitem.Text = mydataset.tables(0).rows(0)("StaffNumber") & " " & mydataset.tables(0).rows(0)("StaffNames")
myitem.Text = mydataset.tables(0).rows(0)("StaffNumber")
ListBox1.Items.Add(myitem)

Hope this helps,
mcg
0
 
PierreBeukesAuthor Commented:
I managed to overcome my error thanks.

the answer that mcgants gave also works great.

Thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.