Passing multiple selected items from a form to a query

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
 
G

Guest

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
 

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