Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

combo box question?

Status
Not open for further replies.

asm338s

Programmer
Jul 16, 2001
135
US
How can I allow the user to select multiple items from a combo box?
 
How would I check to see which values are selected in the listbox when running my sql queries.

Select * from table1 where INLIST(table1.column1, 'value1', 'value2') into.....

*value1 and value2 are multiple values selected by the user from the list
 
First, unless you know that the user can only select 24 or less items, I wouldn't use INLIST. Rather create a cursor with the selected values. Then:
Select * from table1 where ;
table1.column1 IN (SELECT * from mycursor) ;
INTO ...

To process the multiple selected items into the cursor, see the VFP help file for the ListBox Property Multiselect for some sample code.

Rick

 
In a list box, you use the selected property and scan through the list collection as in the following code.

local i, ctext
ctext = ''
with this
for i=1 to .listcount
if .selected
ctext = alltrim(.list[i,1])+','
endif
endfor
endwith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top