Carol,
Do you mean "selection" or "selections" (plural)? Either way, first take a
look at DoCmd.OpenReport in VBA. The syntax is:
DoCmd.OpenReport reportname[, view][, filtername][, wherecondition]The
"wherecondition" is really a filter string. If you use the Filter By Form
feature in Access, apply the filter and then switch to design view of the
form, you'll see the syntax of the filter string you've just created in the
Filter property of the form. It's on the Data Tab of the form's property
page. This will give you an example of how to build your own
"wherecondition" in VBA. Don't forget to delete the value in "Filter" when
you've finished or it gets stored with the form permanently.
The form has to have an Event Procedure behind a command button (e.g.
cmdPreview) that is coded something like:
Private Sub cmdPreview_Click()
DoCmd.OpenReport "myReportName", acViewPreview, ,
"((qryDxsTest.TestID=1))"
End Sub
My example shows a simple filter string where only one item is selected from
the listbox. If you want to support multiple selections from the listbox to
produce one report (personally I'd use a ListView with checkboxes), you'd
have to set the ListBox's Multi-Select property in the form designer and
then, in your cmdPreview_Click event handler, loop through the
ListBox.ItemsSelected collection in VBA.
Hope this helps. If you need more details, please ask.
David Straker