From: Alu_GK on
Hello -
Access 2003, Vista
I have a printing function that runs over a series of items that each item
is a report for itself.
The printing function open a report filtered by the item index, print it,
close it, and move to the next item in the list, and so on...
this process is ok if a have a few items in the list, when it comes to over
100 items, it means that the process is preformed 100 time, and takes a lot
to complete it. The big problem is that the computer is on-hold until the
process finish.
does anybody has an idea how can i print the list of items and avoid from
the delay in the activity of the computer.
any creative idea will be great !!
Thanks.
--
Alu_GK
From: John Spencer on
The printing is going to take some time. There is not much you can do about
that, but in the code that is looping through the reports you can add
DoEvents

What that does is yield time to the processor to accomplish other tasks.

From HELP
DoEvents passes control to the operating system. Control is returned after the
operating system has finished processing the events in its queue and all keys
in the SendKeys queue have been sent.

DoEvents is most useful for simple things like allowing a user to cancel a
process after it has started, for example a search for a file. For
long-running processes, yielding the processor is better accomplished by using
a Timer.


John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

Alu_GK wrote:
> Hello -
> Access 2003, Vista
> I have a printing function that runs over a series of items that each item
> is a report for itself.
> The printing function open a report filtered by the item index, print it,
> close it, and move to the next item in the list, and so on...
> this process is ok if a have a few items in the list, when it comes to over
> 100 items, it means that the process is preformed 100 time, and takes a lot
> to complete it. The big problem is that the computer is on-hold until the
> process finish.
> does anybody has an idea how can i print the list of items and avoid from
> the delay in the activity of the computer.
> any creative idea will be great !!
> Thanks.