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