Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filter Main report by field in subreport.

Status
Not open for further replies.

btrini10

IS-IT--Management
Dec 5, 2006
73
US
For Each varItem In Me!searchownercontributor.ItemsSelected
strFilter6 = strFilter6 & "Reports![Query - Contributors2 subreport2]![Contributors] = " & _
"'" & Me![searchownercontributor].ItemData(varItem) & "' OR "
Next
' the next bit of code will subtract out the last "OR"
If strFilter6 <> "" Then
strFilter6 = Left(strFilter6, Len(strFilter6) - 4)
Else: strFilter6 = "Reports![Query - Contributors2 subreport2]![Contributors] Like '*'"
End If

Above is code I am attempting to us to filter a main report by a filed in a sub-report. Does anyone have suggestions as to how I can get this done. The sub report's field is Reports![Query - Contributors2 subreport2]![Contributors].
Thanks
 
Not sure I am following what you are really trying to do or why...

If you really want to relate to reports and filter one by the other, typically you make the one that gets filtered the sub report and the other report the main report. After that, it is a simple matter of using link master and child fields to get it to work.

Your code looks like a snippet and really does not help me understand what it is doing without the rest of it or knowing what event it is being run on.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top