building SQL string from a multiselect list box

T

tim johnson

I have a listbox with Multiselect is set true. I can
select multiple rows by holding down the Cobtrol button.

If the listbox is called lstDisplay and I select several
rows how can I build it to a SQL string to use in a
procedure. All I need help with is how to build the SQL
sting from the values in the list box.
 
T

Tom

Multiselecting won't work because the selected order will always be from top to bottom - no matter what order you made your selections

Turn off multiselect. Create an empty string. Each time you click an item concatenate it to the string. Have a "Done" button at the bottom that you click when the SQL is complete.
 
J

John Vinson

Multiselecting won't work because the selected order will always be from top to bottom - no matter what order you made your selections.

So? If he's building an IN() or OR... clause in a SQL query, the order
is irrelevant!
 

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