Connecting Tech Pros Worldwide Forums | Help | Site Map

OnPrint Event-2

Newbie
 
Join Date: Oct 2009
Posts: 5
#1: Oct 12 '09
NeoPA,

Thanks for getting back with me.

Your understanding of my issue is correct. I wish to trigger some code (the printing of a separate report) when one report is sent to the printer and not to the screen.

I have code in the "PageHeaderSection" of my main report to perform this function. The code works fine but I only need it to execute one time and that is when the user sends the report to the printer.

Is there any way for Access to detect whether the Print dialog box is open?

Thanks again,

BigJohnT

NeoPa's Avatar
Administrator
 
Join Date: Oct 2006
Location: London - UK
Posts: 15,747
#2: Oct 12 '09

re: OnPrint Event-2


John,

May I ask why you've posted this as a separate thread?

At the very least it needs a link to the other one otherwise it will be very difficult to work on. Were you getting 503 errors by any chance? Service unavailable?
Newbie
 
Join Date: Oct 2009
Posts: 5
#3: Oct 13 '09

re: OnPrint Event-2


NeoPa,

I apologize for the additional level of details. I had problems communicating with the server. I could NOT post a reply to your orginal response.

Below please find my orginal posting with your response. I am not recieving any error messages. My problem is that the second report is printing each time a page is printed to the screen.

===== ORGINAL POSTING ========

Hello Bytes:

I have a MS Access report question.

BACKGROUND:
I have successfully created a report index to be used with my main report. I want this report index to print only if the user decides to manually print the main report (ie. File -> Print).

PROBLEM:
As you know, the OnPrint event executes each time a page is initially displayed on screen. In this case, I do not wish to print the report index.

QUESTION:
Is there a way to evaluate whether the Print Dialog is displayed on screen? If so, can I use it to instruct Access to print my report index?

JUST A THOUGHT:
After the user navigates the report on screen, the onPrint event will no longer fire for those pages displayed. The On Print event will only execute if the User manually prints the report. Can I use this behavior to control the OnPrint event?

Thanks,

BigJohnT

===== YOUR RESPONSE ========

If I understand you correctly John you are wanting to trigger some code (the opening/printing of a separate report) when one report is sent to the printer (The term print here is misleading as Access refers to sending something to the screen as a print - in PrintPreview mode). Is that right?

You should understand that the OnPrint event is only associated with report sections. Not reports or even the printing (sending to printer) of them.

Welcome to Bytes!

====== MY RESPONSE ============

NeoPA,

Thanks for getting back with me.

Your understanding of my issue is correct. I wish to trigger some code (the printing of a separate report) when one report is sent to the printer and not to the screen.

I have code in the "PageHeaderSection" of my main report to perform this function. The code works fine but I only need it to execute one time and that is when the user sends the report to the printer.

Is there any way for Access to detect whether the Print dialog box is open?

Thanks again,

BigJohnT
NeoPa's Avatar
Administrator
 
Join Date: Oct 2006
Location: London - UK
Posts: 15,747
#4: Oct 13 '09

re: OnPrint Event-2


I believe there were some general issues with the service (which seem to be sorted now thankfully). When I get a second I'll tidy this up and lock this one down. We can continue on properly in the original thread.
NeoPa's Avatar
Administrator
 
Join Date: Oct 2006
Location: London - UK
Posts: 15,747
#5: Oct 13 '09

re: OnPrint Event-2


For any interested parties this discussion continues where it originated, at OnPrint Event.
Closed Thread


Similar Microsoft Access / VBA bytes