You can't use the query grid to do this. So, the code behind the button to
print the report will look like:
Dim mysel As Variant
Dim iptr As Integer
Dim strMyWhere As String
For Each mysel In Me.lstMyListBox.ItemsSelected
iptr = CInt(mysel)
If strMyWhere <> "" Then strMyWhere = strMyWhere & ","
strMyWhere = strMyWhere & Me.lstMyListBox.Column(0, iptr)
Next mysel
if strMyWhere <> "" then
strMyWhere = "CustomerId in (" & strMywhere & ")"
endif
docmd.OpenForm "Your report",acViewPreview,,strMyWhere
End Sub
The above means you remove all parameters from the query. In fact, you will
find this much better, as now you don't have to attached each query to some
stupid hard to use expression. (this allows you to re-use the query in more
then one report etc.).
Here is some screen shots of the above idea in action.
http://www.attcanada.net/~kallal.msn/ridesrpt/ridesrpt.html