I have a form where you select multi-certifications of an employee and then run a report to show what they have passed through the use of OpenArgs. That works fine when but the problem I am having is passing the OpenArgs to filter a sub report within the main report. The main report is set up to where you have to enter the employee name in and sub report shows the certifications he has passed. Here is my code to open the report:
Public strFilter as String
Dim varItem As Variant
For Each varItem In Me!lstCertification.ItemsSelected
strFilter = strFilter & ",'" & _
Me![lstCertification].ItemData(varItem) & "'"
Next ' continue loop
If strFilter <> "" Then
strFilter = "[CertID] In (" & Mid(strFilter, 2) & ")"
Else
MsgBox "You did not select any certification(s)."
lstcertification.SetFocus
Exit Sub
End If
DoCmd.OpenReport "rptCertification", acPreview, , , , OpenArgs:=strFilter
On the sub report in the filter property I have tried.
rptCertification.OpenArgs
=strFilter
Neither worked. How do you pass OpenArgs to a sub Report
Public strFilter as String
Dim varItem As Variant
For Each varItem In Me!lstCertification.ItemsSelected
strFilter = strFilter & ",'" & _
Me![lstCertification].ItemData(varItem) & "'"
Next ' continue loop
If strFilter <> "" Then
strFilter = "[CertID] In (" & Mid(strFilter, 2) & ")"
Else
MsgBox "You did not select any certification(s)."
lstcertification.SetFocus
Exit Sub
End If
DoCmd.OpenReport "rptCertification", acPreview, , , , OpenArgs:=strFilter
On the sub report in the filter property I have tried.
rptCertification.OpenArgs
=strFilter
Neither worked. How do you pass OpenArgs to a sub Report