datasource fills listbox to another list box, how to call data?

Sorry if the Subj looks like gibberish I don 't know the lingo yet.

So here is my Noob question.

I have a Windows fom in VBxpress. in this form I have a listbox linked to an AccessDB that works great. Then I tried to set up a second listbox to display the selected items from the the first listbox. I was unable to get the second list box to pull the rest of the row data over. everytime i tried the app would show something like "rowdataview.selected..."

So what i did was convert the displayed member to a string to display it in the second listbox. But now I need to be able to get to the underlying data in the first listbox. How would I do it with just the strings in the second listbox?

Or if you prefer you could show me tha way to bing the selected row of data from the first list box to the second.

the idea is this is an quick estimate for a technican. listbox1 is searchable by keyword, select the service completed(each has an industy std. value/price) so i want to use listbox2 to store and display(only the description) the selected items from listbox1 including the values so I can use a calculate button to sum the values.

Like i said I'm new to this so please be gentle, and use small words.

[1330 byte] By [Toro] at [2008-1-8]
# 1

Hi,

Sorry, I was not exactly clear as to what your problem was, but from whatever I have understood, I think yiu have one ListBox which displays data from database. You want to have the functionality that the value(s) user selects from your First ListBox is moved to the second ListBox, right?

If what I have interpreted above is right then the solution is as follows:

'Consider ListBox1 as the first Listbox which holds the data from the database

'Consider ListBox2 as the second Listbox which will display the records the user has selected from listBox1

Dim drv As DataRowView

drv = ListBox1.SelectedItem

ListBox2.Items.Add(drv(0).ToString)

Hope this solves your problem

Regards


Vineed

Vineed at 2007-10-2 > top of Msdn Tech,Visual Basic,Visual Basic General...