Multiselect List Box pass value to subreports

mixedguy

Registered User.
Local time
Yesterday, 21:21
Joined
Jun 12, 2002
Messages
52
Hello,

I'm trying to pass values from a Multiselect list box to sub reports. I have a report with three sub reports. The first sub report is named "Graph1", second "Report1" and third "Report2."
How would I pass one multiselect list box to all three of these sub reports.

This is the code to pass a value directly to one report:
Private Sub Command6_Click()
For Each varItem In Me![lstOutput].ItemsSelected
StrWhere = StrWhere & "Output_CD=" _
& Chr(39) & Me![lstOutput].Column(0, varItem) & Chr(39) & " Or "
Next varItem

StrWhere = Left(StrWhere, Len(StrWhere) - 4)

DoCmd.OpenReport "qryProj/Output_CM_Chart", acViewPreview, , StrWhere
End Sub

You can either modify my existing code or provide edited changes to it.

Thanks in Advance!!!
 
Do you mean that you want all three subreports to have the same recordsource as the main report?

If so...in the On Open event of the qryProj/Output_CM_Chart report, can you put some code to set the recordsource of the subreports equal to the recordsource of the main report? I don't know the exact syntax as I rarely work with subreports, but if we were talking about forms, then it would be something like:
Me.SubFormName.Form.RecordSource=Me.RecordSource
 
Need further assistance...

What I tried doing which is similar to your advise is, I passed the values from the Multiselect List box to the Main query in the report. Then I did a parent child linkage between the Parent Report and the Three subreports. But b/c it's a multiselect list box the sub report doesn't filter all the selections I pick. The sub report will only filter based on the very FIRST one I pick off the Multiselect list box. I hope I didn't confuse you.

Please advise another way.
Thanks!
 
What I tried doing which is similar to your advise
OK, so you tried something similar, but did you do what I suggested?
 

Users who are viewing this thread

Back
Top Bottom