Re: [RESOLVED] Field Picker
By "ID" do you mean its ListIndex? :confused:
Re: [RESOLVED] Field Picker
No, if I pull the data from a database - I mean the primary key associated with each item.
cheers
Re: [RESOLVED] Field Picker
You are loading lstFrom from a database table, right?
How many primary keys are there on this table?
Re: [RESOLVED] Field Picker
Also, when you have selected what you want from lstFrom and move those items over to lstTo, what happens next?
Re: [RESOLVED] Field Picker
The list on the left contains a list of products that users can click on to compare them.
So, when the list on the right is populated - they will click a 'Compare' button and I will pass the list of ProductIDs (hidden) in the list to retrieve the details from the database.
Thanks again
Re: [RESOLVED] Field Picker
In what will these details be displayed?
Re: [RESOLVED] Field Picker
Let's say the user decides to compare oranges, apples, pears and peaches. I'll be passing say 4,7,9,13 (the ProductIDs) as the parameters to a SQL statement to return various fields which I will then put into an excel spreadsheet for the user to import into their own reporting tool.
Cheers
Re: [RESOLVED] Field Picker
Ok, so if I'm reading you right, you need to build an IN clause which would read
Code:
IN ('oranges', 'apples', 'pears', 'peaches')
With the SELECT whatever FROM whatever WHERE product etc.
Is this right?
Re: [RESOLVED] Field Picker
Hi, sorry, I'm not explaining myself very well.
I need to be able to associate a productID with the products listed in each box.
So the one on the left might contain:
4 Oranges
7 Apples
6 Peaches
23 Pineapples
15 Plums
29 Grapefruit
Where 4,7,6,23,15,29 are the respective Product IDs but which are hidden from the user.
And, by the time the user has clicked on three products the right box might contain:
7 Apples
6 Peaches
15 Plums
I need to be able to retrieve the ProductIDs - 7,6 and 15) so I can pass them to a Select statement whose WHERE clause will look like ...
WHERE ProductID = 7 OR ProductID = 6 OR ProductID = 15
Cheers
Re: [RESOLVED] Field Picker
You are explaing yourself, but this
Code:
WHERE ProductID = 7 OR ProductID = 6 OR ProductID = 15
is not the way to do it.
The way to do it is:
Code:
WHERE productID IN (6, 7, 15)
Re: [RESOLVED] Field Picker
Okay - understand you should use 'IN' instead of multiple 'ORs' - but how do I associate the ProductIDs with the Products in each box?
Cheers
Re: [RESOLVED] Field Picker
Tell me your database table design.
How are they laid out with respect to productIDs, products and product details?
Are you using just one table for all of this or are there multiple tables involved?
(Incidentially, until we get this worked out, edit the first post and backspace RESOLVED out of the thread title, then scroll down to the icon section and click No Icon - you can click the Mark Thread Resolved again later on.)