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 Report using field on sub-report

Status
Not open for further replies.

btrini10

IS-IT--Management
Dec 5, 2006
73
US
Hello
Following is code I have that filters a report based on a field on a subreport. The code seems to work because it does not ask for the parameter, but it is not finding any values.

For Each varItem In Me!searchownercontributor.ItemsSelected
strFilter6 = strFilter6 & "Reports![Report - All Findings]![Query - Contributors2 subreport2].Report![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![Report - All Findings]![Query - Contributors2 subreport2].Report![Contributors] Like '*'"
End If

If I do not select a value, following is what shows in the immediate screen.

(Reports![Report - All Findings]![Query - Contributors2 subreport2].Report![Contributors] Like '*')

Can someone tell me what is wrong with my statement?

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top