Hi,
Added some code to print out a bunch of report to PDF or the printer in one shot. Problem is that it runs the first two reports and then hangs (task manager indicated not responding). To try and see where the problem may be, I added some message boxes to tell me when it finishes one report and starts working on the next report. When I ran the code with the message boxes, all the reports run fine and the computer didn't hang. Of course, having the message box defeats some of the purpose since user action is required. Is there some additional code or other modification I can do to get all the reports to run and print without user interaction or hanging.
Note: RunReportAsPDF came from tek-tips (can't recall the thread number)
Added some code to print out a bunch of report to PDF or the printer in one shot. Problem is that it runs the first two reports and then hangs (task manager indicated not responding). To try and see where the problem may be, I added some message boxes to tell me when it finishes one report and starts working on the next report. When I ran the code with the message boxes, all the reports run fine and the computer didn't hang. Of course, having the message box defeats some of the purpose since user action is required. Is there some additional code or other modification I can do to get all the reports to run and print without user interaction or hanging.
Code:
Do While Not rs.EOF
Call RunReportAsPDF(rs!reportname, "c:\temp\" & Replace(Mid(rs!reportname, 4), "by", Format(dtRunDate, "yy") & stLevel & Format(dtRunDate, "yyyymmdd") & "-") & ".pdf")
MsgBox "Finished with " & rs!reportname 'for testing
rs.MoveNext
MsgBox "Now doing " & rs!reportname 'for testing
Loop
Note: RunReportAsPDF came from tek-tips (can't recall the thread number)