Passing multiple selected items from a form to a query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

Can you please let me know how to pass multiple selected items from a list
box on a form to a query using the "IN-clause"? the field (productID) is a
text field. here is the sample code that doesn't work:

SELECT OrderDetail.ProductID
FROM OrderDetail
WHERE (((OrderDetail.ProductID)=[forms]![profit_margin]![lstItemsSelected]));

thanks you in advance!

Michelle
 
Hey, Duane,

It works exactly how I wanted!! Thank you so much!

Michelle

Duane Hookom said:
There is a generic function for doing this at
http://www.rogersaccesslibrary.com/OtherLibraries.asp#Hookom,Duane.

--
Duane Hookom
MS Access MVP

Michelle said:
Hello,

Can you please let me know how to pass multiple selected items from a list
box on a form to a query using the "IN-clause"? the field (productID) is
a
text field. here is the sample code that doesn't work:

SELECT OrderDetail.ProductID
FROM OrderDetail
WHERE
(((OrderDetail.ProductID)=[forms]![profit_margin]![lstItemsSelected]));

thanks you in advance!

Michelle
 
Back
Top