Cancel=True cancels multiple reports

R

Ray Cacciatore

I have a While loop that sends a report to the printer for each employee.
In my code I first set a global value that the report uses:

Do While Not rs.EOF
Set MyGlobalValue = rs![EmployeeID]
OpenReport "MyReport", acViewNormal ' send straight to the printer
rs.MoveNext
Loop

The problem is that when the report has no data for one employee, all the
reports seem to get cancelled. None are sent to the printer. I have
"Cancel=True" behind the report on the NoData event.

The report itself is very complex. It programmatically creates a temporary
table and then the report is based on this temporary table. So my options for
a solution are limited.

Any suggestions?

Thanks in advance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top