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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error handling

Status
Not open for further replies.

weeze2

Technical User
Jun 18, 2002
129
DK
Hi.
If one has a report that needs to be printed, but the report is pictures, and many of them. At some time during the printing process(usualy half way through), a message pops up with something -"out of memory" .This is becuase the report consiscts of about 1000 and I guess there is not enough mem. to make the whole report...dunno realy.

Anyway
my problem is that I need to insert some error handling, that would take the last page made, and continue printing a new job from there. This way the whole report can be written out. I therefore need to insert VBA in the onprint part of the report, to catch the error and call a new print to start printing from pagenumber "Pages".

Does anyone have an idea of what the code could look like?
 
Unfortunately, when you receive this error, it too late to do anything about it. You need to find out how many pages will print before the problem happens, not when it happens. Put some debug lines in the code in the Report_Page event to print the page number when you get to this point.

Since the size of the pictures can vary, you might not always get to the same page each time if different pictures are used. Subtract a page or two from your final number. You'll probably have to change the query so you can start at the next picture from where you left off on the previous report.
 
Thanks!
As I understand, it should print a fixed amount of pages, maybe 1/4 of the pages, Then call a print from the remaining pages, print to 50% and so on. I think this will work! :eek:)

But is it very complicated to do this in VBA in the onPrint event?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top