Printing Access Report Via Module Fails to Trigger 'On Activate' E

  • Thread starter Thread starter CWFitz
  • Start date Start date
C

CWFitz

In a multi-user environment, a user completes an Access Form then clicks a
"Print" Command Button which triggers a module. The module is constructed to
generate some 80 separate reports, each different based on the user's entry
form. The reports are printed directly to a network address in Adobe pdf
format (Using Adobe print driver as the default printer). The system has been
working well for about five years; It's an Office 2003 Access installation.
Here's the problem: I modified the structure of a single report,
programmatically setting the content (Control Source)of two text boxes on the
form. The modification is triggered by the 'On Activate' event. The module
line that generates the report is:

DoCmd.OpenReport "WilkesPawnReport#6", acViewNormal

....where the default printer is Adobe, ported to a network folder. The
result is that the two text boxes are not printed. Actually, I tried to trap
the error but found that that 'On Activate' is not triggered when the print
action is generated from the programming module. I can view the report singly
from Access in Print Preview mode, send it to Adobe and it works fine.

Here's the question: how can I have users generate these reports from a
module and still have the 'On Activate' event triggered.

Any assistance is appreciated.
 
In a multi-user environment, a user completes an Access Form then clicks a
"Print" Command Button which triggers a module. The module is constructed to
generate some 80 separate reports, each different based on the user's entry
form. The reports are printed directly to a network address in Adobe pdf
format (Using Adobe print driver as the default printer). The system has been
working well for about five years; It's an Office 2003 Access installation.
Here's the problem: I modified the structure of a single report,
programmatically setting the content (Control Source)of two text boxes on the
form. The modification is triggered by the 'On Activate' event. The module
line that generates the report is:

DoCmd.OpenReport "WilkesPawnReport#6", acViewNormal

...where the default printer is Adobe, ported to a network folder. The
result is that the two text boxes are not printed. Actually, I tried to trap
the error but found that that 'On Activate' is not triggered when the print
action is generated from the programming module. I can view the report singly
from Access in Print Preview mode, send it to Adobe and it works fine.

Here's the question: how can I have users generate these reports from a
module and still have the 'On Activate' event triggered.

Any assistance is appreciated.

1) The report's Activate event fires ONLY if the report is Previewed.
Open the report in acViewPreview instead of acViewNormal.

DoCmd.OpenReport "WilkesPawnReport#6", acViewPreview

Then print the report from the Preview window..

2) What do you mean by this sentence?
setting the content (Control Source)of two text boxes on the
form.

Do you mean ... setting the content (Control Source) of two text
boxes on the REPORT. ?
If you are attempting to set the value of an unbound control on the
report to that of a control on a form, use the Report's Report Header
Format event, not the Open or Activate events. Now you can print
without preview.
 
CWFitz said:
In a multi-user environment, a user completes an Access Form then clicks a
"Print" Command Button which triggers a module. The module is constructed to
generate some 80 separate reports, each different based on the user's entry
form. The reports are printed directly to a network address in Adobe pdf
format (Using Adobe print driver as the default printer). The system has been
working well for about five years; It's an Office 2003 Access installation.
Here's the problem: I modified the structure of a single report,
programmatically setting the content (Control Source)of two text boxes on the
form. The modification is triggered by the 'On Activate' event. The module
line that generates the report is:

DoCmd.OpenReport "WilkesPawnReport#6", acViewNormal

...where the default printer is Adobe, ported to a network folder. The
result is that the two text boxes are not printed. Actually, I tried to trap
the error but found that that 'On Activate' is not triggered when the print
action is generated from the programming module. I can view the report singly
from Access in Print Preview mode, send it to Adobe and it works fine.

Here's the question: how can I have users generate these reports from a
module and still have the 'On Activate' event triggered.


The Activate event (OnActivate is a property) only occurs
when the report's window is made active. When a report is
opened in normal view, it goes directly to the printer
without ever creating a window. Find a different event to
use.

Most folks set up the report's "parameters" using a form and
the report's Open event (or maybe a section's Format event)
to pull the infornation from the form and plug it into the
report. OTOH, filtering the report is best done using the
OpenReport method's WhereCondition argument.
 
This past Monday, October 20, I had a module that printed to the specific
printer "Adobe PDF" fail after more than two years of operating properly. I
also am running Access 2003 in a multi-user Windows XP environment. I
recalled that my laptop asked for permission to install an Acrobat update
last weekend. (I run the interrupted routine from my desktop. Perhaps the
update settings on the desktop allowed the upgrade to install automatically.)
I can't help but wonder if the upgrade or the emergency Windows update (or
the need for it) this week created the error.

Thoughts, anyone...
 
Back
Top