multi-column listbox

Chose.cz

Registered User.
Local time
Today, 23:39
Joined
Aug 8, 2006
Messages
12
hello,

I have a form with a listbox containing columns"ID", "Name", "Surname"
User can select multiple rows. Upon clicking OK button, selected rows are inserted into a table. Important part of code behind OK button:

For Each i In Combo6.ItemsSelected
rst.AddNew
rst![ID] = Combo6.ItemData(i)
rst.Update
RecCount = RecCount + 1
Next i

This only inserts ID column into a table. How do I refer to contents of listbox columns "Name" and "Surname", so that I can insert them as well? I guess I have to bypass BoundColumn property somehow.

Thanks in advance
 
Hello

To reference the different columns in a list box or combo box you would do the following:
'
YourComboName.Column(0)
YourComboName.Column(1)
YourComboName.Column(2)

0 is the first column, 1, second column, 2, third column and so on.
Regards
Mark
 

Users who are viewing this thread

Back
Top Bottom