>I have a form with a listbox (list4) which displays all employees. When the user presses the ALL button all employees are selected. I want to print a report for all selected employees. The following code keeps prompting me to enter a parameter value for list4. I thought if all of the employees were selected, that was the parameter. Any help would be appreciated.
>
>
Const RName = "Transaction Report"
>Dim Name, WClause
>For Each Name In Me![List4].ItemsSelected
> WClause = "[list4] = '" & Name & "'"
>DoCmd.OpenReport ReportName:=RName, WhereCondition:=WClause, View:=acViewPreview
>
>Next
>For Name = 0 To Me![List4].ListCount - 1
> Me![List4].Selected(lrow:=Name) = False
>Next
So list4 is a field in the report's data source?
Seems to me, if you have selected all employees (meaning no filter) the WhereCondition should not be used. In which case, you could have two ways of calling the report, one with wherecondition if all items are not selected and one where the selected list is passed to wherecondition.
Or did I misunderstood something?