473,461 Members | 1,857 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

OnPrint Event

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
Oct 10 '09 #1
4 7757
NeoPa
32,556 Expert Mod 16PB
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!
Oct 10 '09 #2
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
Oct 13 '09 #3
NeoPa
32,556 Expert Mod 16PB
As far as I can see, Access doesn't differentiate between where it sends the printed report. As far as the code knows, it goes to the printer. If it is only sent to the screen, then what does it care (so to speak). Not good news for you I know. I know of no way to capture the actual act of printing per se. It may be possible to do it through Operating System calls, but I don't know them well enough to be able to help there I'm afraid.

Another expert may have some help to offer though. Let's see what turns up.
Oct 13 '09 #4
NeoPa,

I thank you for your time. Lets see what turns up.

Thanks again.

BigJohnT
Oct 14 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Andy Read | last post by:
Hello all, I have the requirement to produce source code that produces an object hierarchy. Example: Root | Folder 1
18
by: Christopher W. Douglas | last post by:
I am writing a VB.NET application in Visual Studio 2003. I have written a method that handles several events, such as closing a form and changing the visible status of a form. I have some code...
8
by: Mark | last post by:
Hi, I'm looking for some ideas on how to build a very simple Event processing framework in my C++ app. Here is a quick background ... I'm building a multithreaded app in C++ (on Linux) that...
0
by: Liz McCausland | last post by:
I am trying to use the OnFormat and OnPrint functions to produce 2 copies of a report with different headers and some controls not visible on one of the copies. I have done this in Access 2 but...
13
by: Charles Law | last post by:
Mr "yEaH rIgHt" posted the following link about a week ago in answer to my question about removing event handlers. > http://www.vbinfozine.com/t_bindevt.shtml Following on from that post, the...
12
by: Jack Russell | last post by:
My unstanding of all VB up to and including vb6 is that an event could not "interrupt" itself. For instance if you had a timer event containing a msgbox then you would only get one message. ...
41
by: JohnR | last post by:
In it's simplest form, assume that I have created a usercontrol, WSToolBarButton that contains a button. I would like to eventually create copies of WSToolBarButton dynamically at run time based...
9
by: jeff | last post by:
New VB user...developer... Situation...simplified... - I want to wrap a pre and post event around a system generated where the pre-event will always execute before the system event and the...
4
by: BigJohnT | last post by:
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.