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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select two more items in one Combobox and use SQL to display the table

Status
Not open for further replies.

chuanwang

Technical User
Jul 24, 2002
55
0
0
SE
Does some know how to select two more items in one Combo-box, then use some SQL to display one table? These items are located in the same field of one table (the original table is from Access, and can be displayed in FlexGrid in VB).

Also, if we can put two more item or criteria in one text-box, then use SQL to display the table metioned above, it is also OK. use some codes like:
mySQL = "SELECT * FROM tblResults WHERE ((tblResults.field1) like '" & Text1.Text "
But it only cover one item. How about two, three more item.

I hope someone can solve this problem. Chuan Wang
Royal Institute of Technology
Stockholm, Sweden
Homepage:
 
Sir you need to use the IN Operator.

WHERE vend_id IN ('DLL01','BRS01')

John
 
Sorry I do not understand exactly what your code mean! What does it mean 'DLL01' and 'BRS01', can you give me detail explain.

thanks Chuan Wang
Royal Institute of Technology
Stockholm, Sweden
Homepage:
 
Use a listview or a listbox with multiselect set to true to get your data.

I refer you again to my answer in thread222-332698 Let me know if this helps
________________________________________________________________
If you are worried about how to post, please check out FAQ222-2244 first

'There are 10 kinds of people in the world: those who understand binary, and those who don't.'
 
Sir,
You would get your items from text boxes or combo-box and place from one to many to search in a IN Operator.

WHERE fieldName IN ('Text1.text','Text2.text','Textn.text')

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top