View Full Version : Printing multiple forms


DataMiner
05-15-2002, 10:25 AM
Hi,
I need to print multiple forms automatically every morning; each form contains one or more MSgraph objects. The way I am currently doing this is:

docmd.openform MyForm1, acnormal
docmd.printout
docmd.close acForm,MyForm1,acsaveyes
docmd.openform Myform2,acnormal
docmd.printout
docmd.close acform,myform2,acsaveyes

etc. ....About 20 iterations of this.

Most of the time it works OK, but sometimes some of the printouts get skipped, or the docmd.printout seems to grab the wrong form for printing. Is there a more reliable way to do this? Something like Myform.printout?

Travis
05-15-2002, 12:19 PM
Try adding "DoEvents" after the Close of the forms. Its possible that the processor needs more time to change between forms.

DataMiner
05-15-2002, 12:25 PM
I have tried "doevents" in the past, with only limited success. This morning, the very first form that was supposed to print, didn't; a different form that was open at the same time printed instead. Is "doevents" likely to help with this? How do I insure that docmd.printout prints the correct form? Do I need to use a setfocus to the form I want to print just before the docmd.printout?