Is it possible to know whether a Report has been printed or Not? (1 Viewer)

prabha_friend

Prabhakaran Karuppaih
Local time
Today, 21:31
Joined
Mar 22, 2009
Messages
783
If it is... How many times its been printed?

Possible? Pease Help.

Thanks & Regards,
Prabhakaran
 
Last edited:

Minty

AWF VIP
Local time
Today, 17:01
Joined
Jul 26, 2013
Messages
10,371
If you have code to make it print then you could record the action in a table.

Alternatively, you could have code running in the report Header On_Print event that logged the action in a table?
If someone just previews it though that might give you some false results.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 09:01
Joined
Oct 29, 2018
Messages
21,467
It's only possible to determine how many times the user attempted to print a report, not how many times it actually printed.
 

prabha_friend

Prabhakaran Karuppaih
Local time
Today, 21:31
Joined
Mar 22, 2009
Messages
783
If you have code to make it print then you could record the action in a table.

Alternatively, you could have code running in the report Header On_Print event that logged the action in a table?
If someone just previews it though that might give you some false results.
Is it possible to create/provide a custom print preview window along with a custom print button which finally prints and counts the same... Possible? Please reply. Thank You.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 11:01
Joined
Feb 28, 2001
Messages
27,171
I believe the print preview window's code is NOT something you can modify using VBA. It is something buried in Access itself, or perhaps in Windows as one of their "standard" dialogs. So "Can you create a custom print preview window?" No... but maybe yes if you are willing to work a bit on a workaround. You have to bypass the "standard" print preview window by NOT trying to print through that window, but instead directly interacting with the printer object that would be hidden BEHIND that window.


If you know the properties to load to the printer object, which you could "ask" through a "roll your own" type of form, and then directly send to the printer yourself, you would at least know exactly what you asked to be done and could record that.

You would have to have found the specific printer you wanted to use through the Application.Printers collection before you diddle with the printer.


Since nobody directly prints in Windows any more, I don't know that you can easily tell that something actually got printed. What happens these days is that you create an entry into the printer queue (a WINDOWS data structure independent of Access) and that entry might be waiting for a while depending on backlog, paper jams, empty paper trays, and other common office printer events. In a big-enough domain environment, it would be possible that your print request would be sent to another system for handling. In that case, the answer of whether you could tell how many times it was actually printed is a qualified "NO." IF you could even see it, which might not be allowed due to Windows security settings, you would have to somehow interact with the printer queue, and that would be an API function, certainly not related to the "preview window" at all.

You could also find other articles in this forum using the SEARCH feature because you are not the first person to have asked this question. Someone might have printed an obscure way to do what you want, but you WILL be stepping outside of Access to do it.
 

Users who are viewing this thread

Top Bottom