Review mode deadly embrace

R

rsosabusiness

Access 1000 - We have a simple payroll database. A payment statement is
printed in two situations: when a payment is made and recorded and when
for some reason a prior payment statement is requested. In both
situations the payment statement is the same report, but is invoked
from two different forms, one form for each situation. The report uses
screen.activeform to obtain the data from each form. This is possible
because the forms have the same names for the data that appears in the
reports. In the first situation (recording a payment), we print two
copies, one for the employee and one for our files. In the second
situation, only one copy. I thought that it may be advantegeous for the
user to preview the report before printing it, and that the correct
number of copies be printed as indicated by the invoking form. However,
I've discovered that using the preview mode causes all the boxes that
are filled with data from the form to show 'error', as if the pointer
to the active form had been lost. The system works, so this is nor
urgent, but it offends my sense of neatness that the two copies are
obtained by performing the docmd.openreport twice. Using the
docmd.printout to specify number of copies requires a preview, which
results in the errors. Therefore I can see why docmd.openreport is used
twice. But doing it that way means that the user cannot see what's to
be printed. I do not understand why the errors occur only when
printing from the preview mode. I know just enough Access and VBA to
get by. Does anyone know the cure to this deadly embrace?
Cordially,
Robert
 
K

Klatuu

Deadly Embrace in database terminology means two process attempting to lock
the same record/table at the same time and neither can complete or exit the
procedure.

As to your delima. Check VBA Help for the PrintOut method of the Docmd
object. You can use that it the Open event of your report to determine the
number of copies to print.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top