I have a form where you select an employee and then there is a multi select list box where you select the projects you want to print for that employee. I can get the main report to open with all the employee information but the problem I am having is I am not able to pass the filter (the projects that were selected) to the subreport (the subreport contains all the project information).
Here is the code I am using to save the filter as a string and open the main report(rptCustomResume)
Public strFilter as string
Dim varItem As Variant
For Each varItem In Me!lstProjects.ItemsSelected
strFilter = strFilter & "[EPRproid] = '" & _
Me![lstProjects].ItemData(varItem) & "' OR "
Next ' continue loop
If strFilter <> "" Then
strFilter = Left(strFilter, Len(strFilter) - 4)
Else
MsgBox "You did not select any project(s)."
lstProjects.SetFocus
Exit Sub
End If
DoCmd.OpenReport "rptCustomResume", acViewPreview
I need strFilter to filter a subreport called rptCustomResume-ProjectsSub.
Thanks in advance for your help
Here is the code I am using to save the filter as a string and open the main report(rptCustomResume)
Public strFilter as string
Dim varItem As Variant
For Each varItem In Me!lstProjects.ItemsSelected
strFilter = strFilter & "[EPRproid] = '" & _
Me![lstProjects].ItemData(varItem) & "' OR "
Next ' continue loop
If strFilter <> "" Then
strFilter = Left(strFilter, Len(strFilter) - 4)
Else
MsgBox "You did not select any project(s)."
lstProjects.SetFocus
Exit Sub
End If
DoCmd.OpenReport "rptCustomResume", acViewPreview
I need strFilter to filter a subreport called rptCustomResume-ProjectsSub.
Thanks in advance for your help