G
Guest
I have two problems when printing reports.
1. By providing separate print preview and print command buttons on a form,
it is simple to preview or print reports by means of the appropriate View
parameters in the DoCmd OpenReport command strings associated with the
buttons. However, a need has now arisen for (a) multiple copies and/or (b)
the facility to send these copies to different printers, or to different
paper feed bins. DoCmd OpenReport does not offer multiple copy selection.
Nor can I see how to redirect a print or send command characters to the
printer. I note that PrintOut does enable the number of copies to be set but
it is not apparent how this can be used in conjunction with DoCmd OpenReport.
I employ a terminating argument in the OpenReport command line to determine
whether or not the report header should be output. (This is displayed on
Preview but not on Print, which is done on headed stationery.) The argument
takes the form “Preview†or “Printâ€, which is read by the report VBA, using
the OpenArgs command. (I cannot see how to read the View parameter directly,
which would save the need to pass a separate argument.) This works well for
single printer, single sheet, single feed bin situations but I am at a loss
to see how to combine printer selection, paper feed bin selection multiple
copy selection and argument transfer.
2. It is a requirement that reports be previewed before being printed. This
is achieved by interlocking the preview and print buttons on the form. The
print button is not made visible until the preview button has been clicked.
Ideally, the print button should not be made visible until the report preview
window has been closed but the preview window appears to remain under the
control of the OpenReport command and I cannot see how to determine its
status or use this to control the visibility of the print button. (I have an
IsFormOpen subroutine which will identify whether a form is open, or not, but
it is not apparent how anything like this could be used with the print
preview window, which I cannot currently identify.) I therefore have no
option but to make the print button visible as soon as the preview button is
clicked. This was just about acceptable until it was found that, if the
print button is clicked while the preview window is open, the print takes
place OK but the “Print†argument is ignored. The “Preview†argument
associated with the open preview window controls the print which, in the case
described above, means that the header is printed over the top of the
pre-printed header on the headed stationery. I need a method of making the
print command button visible only after the preview window has been closed.
This would then automatically resolve the problem of transferring the
appropriate argument with the OpenReport print command.
1. By providing separate print preview and print command buttons on a form,
it is simple to preview or print reports by means of the appropriate View
parameters in the DoCmd OpenReport command strings associated with the
buttons. However, a need has now arisen for (a) multiple copies and/or (b)
the facility to send these copies to different printers, or to different
paper feed bins. DoCmd OpenReport does not offer multiple copy selection.
Nor can I see how to redirect a print or send command characters to the
printer. I note that PrintOut does enable the number of copies to be set but
it is not apparent how this can be used in conjunction with DoCmd OpenReport.
I employ a terminating argument in the OpenReport command line to determine
whether or not the report header should be output. (This is displayed on
Preview but not on Print, which is done on headed stationery.) The argument
takes the form “Preview†or “Printâ€, which is read by the report VBA, using
the OpenArgs command. (I cannot see how to read the View parameter directly,
which would save the need to pass a separate argument.) This works well for
single printer, single sheet, single feed bin situations but I am at a loss
to see how to combine printer selection, paper feed bin selection multiple
copy selection and argument transfer.
2. It is a requirement that reports be previewed before being printed. This
is achieved by interlocking the preview and print buttons on the form. The
print button is not made visible until the preview button has been clicked.
Ideally, the print button should not be made visible until the report preview
window has been closed but the preview window appears to remain under the
control of the OpenReport command and I cannot see how to determine its
status or use this to control the visibility of the print button. (I have an
IsFormOpen subroutine which will identify whether a form is open, or not, but
it is not apparent how anything like this could be used with the print
preview window, which I cannot currently identify.) I therefore have no
option but to make the print button visible as soon as the preview button is
clicked. This was just about acceptable until it was found that, if the
print button is clicked while the preview window is open, the print takes
place OK but the “Print†argument is ignored. The “Preview†argument
associated with the open preview window controls the print which, in the case
described above, means that the header is printed over the top of the
pre-printed header on the headed stationery. I need a method of making the
print command button visible only after the preview window has been closed.
This would then automatically resolve the problem of transferring the
appropriate argument with the OpenReport print command.