The report is generated by a query here is what it looks like: query is
"allemployee"
I'd suggest stepping through the code in debug mode, and displaying
the WhereCrit string. If you copy and paste WhereCrit onto the
Criteria line of the query in design view, and then open the query, do
you get the expected results?
Note that you can do this a bit more compactly using the IN() clause:
WhereCrit = "RecordID IN("
For Each v In ctl.ItemsSelected
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'Coordinates: 1st column (0); row v
'where v changes for each round of the loop.
theId = ctl.Column(0, v)
'Tag on to string.
WhereCrit = WhereCrit & theId & ","
Next v
WhereCrit = left(WhereCrit, Len(WhereCrit) - 1) & ")"
John W. Vinson[MVP]