look at the vba help for the "Inselect" property. There is a code example there that will help you get the multiple values selected.
You need to build a SQL statement in the form of a string based on those values, and then assign that string to the sql property of the pass thru.
Lets say you have written a function that loops through the selected items of the list box and creates the proper SQL statement. Lets say that that function is called "CrSQLStr". Then:
Dim SQLString as String
Dim CurrDB As Database
Set CurrDB = CurrentDb
SQLString = CrSQLStr(me.ListBox1)
CurrDB.QueryDefs("qryPassThru").SQL=SQLString
|