Hello,
I've read through this forum, and it appears many people have a similar problem. I've read the solutions offered, but can't seem to make any of them work. I need to run multiple reports (i.e. 1 report for each item selected in a listbox on a form) where the item/items selected becomes the criteria for the query. I can make the listbox work, but it only returns the last item selected, not all items selected and I can't get the listbox selection into the query.
I've tried to do something like..
stDocName = "Report"
Dim I As Long
With List1
For I = 0 To List1.ListCount
If .Selected(I) = True Then
' Here's where the trouble starts...
criteria = list1.column(0,I)
DoCmd.OpenReport stDocName, acPreview
End If
Next I
End With
I've read through this forum, and it appears many people have a similar problem. I've read the solutions offered, but can't seem to make any of them work. I need to run multiple reports (i.e. 1 report for each item selected in a listbox on a form) where the item/items selected becomes the criteria for the query. I can make the listbox work, but it only returns the last item selected, not all items selected and I can't get the listbox selection into the query.
I've tried to do something like..
stDocName = "Report"
Dim I As Long
With List1
For I = 0 To List1.ListCount
If .Selected(I) = True Then
' Here's where the trouble starts...
criteria = list1.column(0,I)
DoCmd.OpenReport stDocName, acPreview
End If
Next I
End With