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
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