Hi ,
I have a report and listbox which I use to filter the report .The code is
The porblem is that the report is opened up , but it doesn't show the Client Name..iT Says "error" on the report .I have checked everything and it seems everything correct , but it doesn't work .Please, look at the code,may be you point out something that I have overlloked.
Thank you ,
Regards
Private Sub SumByClients_Click()
Dim stDocName As String
Dim Criteria As String
Dim i As Variant
stDocName = "SUMCHECKSPTINTEDQB2011"
Criteria = ""
For Each i In Me![List27].ItemsSelected
If Criteria <> "" Then
Criteria = Criteria & " OR "
End If
Criteria = Criteria & "[ClientName]='" _
& Me![List27].ItemData(i) & "'"
Next i
DoCmd.OpenReport stDocName, acPreview, , Criteria
Me.Filter = Criteria
Me.FilterOn = True