Hi everyone,
i am really stack!i need help
I have this report:"Require mentObjects_Rep ort",i have also a multiselect listbox whicg contains a list of products.what i want to do is to filter the above report based on the products that i have selected.
here is my code but it seems that my filter does not work properly and get the entire report back(Requiremen tObjects_Report )
[CODE=vb]Private Sub GenerateReport_ Click()
Dim var As Variant
Dim strF As String 'holds report filter
If Me.ProductList. ItemsSelected.C ount <> 0 Then
For Each var In Me.ProductList. ItemsSelected
strF = Me.ProductList. Column(0)
Next var
'now call the report with filter
DoCmd.OpenRepor t "RequirementObj ects_Report", acViewPreview, strF
Else
MsgBox "Please select some items from listbox."
End If
On Error GoTo Err_GenerateRep ort_Click
Err_GenerateRep ort_Click:
MsgBox ("blabla")
End Sub[/CODE]
Could someone give me some idea about it!
Do i need a sql statement??(tho ugh i think it is not needed since i am using strF as a filter)
i am really stack!i need help
I have this report:"Require mentObjects_Rep ort",i have also a multiselect listbox whicg contains a list of products.what i want to do is to filter the above report based on the products that i have selected.
here is my code but it seems that my filter does not work properly and get the entire report back(Requiremen tObjects_Report )
[CODE=vb]Private Sub GenerateReport_ Click()
Dim var As Variant
Dim strF As String 'holds report filter
If Me.ProductList. ItemsSelected.C ount <> 0 Then
For Each var In Me.ProductList. ItemsSelected
strF = Me.ProductList. Column(0)
Next var
'now call the report with filter
DoCmd.OpenRepor t "RequirementObj ects_Report", acViewPreview, strF
Else
MsgBox "Please select some items from listbox."
End If
On Error GoTo Err_GenerateRep ort_Click
Err_GenerateRep ort_Click:
MsgBox ("blabla")
End Sub[/CODE]
Could someone give me some idea about it!
Do i need a sql statement??(tho ugh i think it is not needed since i am using strF as a filter)
Comment