Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print Multiple Reports From a Command button

Status
Not open for further replies.

ittech73

Programmer
Jul 29, 2002
9
US
I currently have a list box containing the report names and when one is selected the report is printed. What I want to do is when I click a command button have several reports print at the same time. The problem is any one or mor than one can have NO DATA in the report. I have a procedure that creates the tables containing the data. Then the procedure will start printing the reports if it runs across one with no data, I have error trapping set in place to catch this and send a message to the user about the report and that no data was found. The first time I come to a report with no data is not a problem. It traps the error and I then have it resume to the next report. When it happens a second time Access doesn't allow the error to be trapped by my code instead it just blows up. So this make it unable for me to be able to resume to the next report after finding a report with no data the second time. Any suggestions are welcome.
 
Use each report's OnNoData event to trap them instead of in the code.

Alternatively you could pull a recordset (ADO or DAO) prior to calling the reports to see if there is no data.

Hope this is of help.

Regards
Warwick
 
If you have more than one report with no data it will still blow up. Since technically as far as Access is concern you have not left that error event. I have already tried the NoData Event.

I have already came up with the solution. You trap for the error and use Resume Next. If you want a description screen to pop up about the report containing no data you can take care of that in the NoData Event.
Thanks anyway!!!!
ITTech73
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top