Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run when actually printing not previewing 1

Status
Not open for further replies.

GPM4663

Technical User
Aug 9, 2001
165
GB
Hi Everyone,
I'm trying to get some code to run whenever a report is printed. The report is previewed first and then the user prints the report. I want to run a bit of code to confirm that it has physically been printed and not just previewed. However, when I put the code in the Detail_Print event it runs whenever the report is previewed.

How can I get the code to run when the report is physically printed and not just previewed.

thanks for all the help

GPM
 
A few questions and or suggestions.

Is this done from 2 different buttons ? eg. preview and print. If so, you can put in vb to do the counting.

If not, you will have to have a paramter which you can pass to the report and interpret the paramater in your Print Event.

Remember when... everything worked and there was a reason for it?
 
I think the best bet might be to set up your own menu with print set to a function.
 
Hi,
The Preview is done from a form using Docmd.openReport "Report1",acViewpreview. The User then checks the report and if they want to print it they just use the file->Print button on the main toolbar along the top....it's this event I want to capture - that someone has actually sent it to the printer.

Any ideas?

thank

GPM
 
I tend to agree with Remou. I am not sure how to you can ascertain if the print key was hit or the preview key in ACCESS.

Remember when... everything worked and there was a reason for it?
 
You can set up your own menubar by choosing Customize from the Tools menu and setting the On Action property of the Print command and/or button to a function that you have built, for example:

Code:
Function PrintTrap
MsgBox "Hi"
DoCmd.RunCommand acCmdPrint
End Function
 
Thanks Guys,
I've created my own toolbar and linked it with the report. It works perfectly. I'm going to switch off the main toolbar so that it forces the user to use the one I've created as well.

Thanks a lot for all the help,

GPM
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top