Printout action called from custom shortcut menu

wallymeister

Registered User.
Local time
Today, 00:18
Joined
May 10, 2011
Messages
30
Hi all
I am stumped and don't know if there is a way to do this or not but.......

I have created custom shortcut menu with Print the only option for the user. It uses the Printout Action to send the report to the default printer. I need to capture that the user printed the report so I can set some other properties based on that fact. (Make another button visible when the report has been printed) I see no way to do this.

This whole problem arose because I tried just adding code in the Close event of the report to ask user if they want to print the report but I get error that can't run this action while running a form or report event. So I tried another approach and that's where I am at now.

The reports are opened in dialog mode to keep the user out of everything so they can only preview the report and close it. I want them to have the option to print also. If they do I need to change visible property of a button.

Maybe if I Call a subroutine from the custom shortcut menu and in that routine before I use the printout method there set visible property of other button.

Hmmm....
I'll try this but in the meantime if anyone has another idea, I'd certainly welcome any suggestions.

Thanks,
Wally
 
You could use Code (vba) to do everything.
eg have one button that when clicked asked the operator if they want to Preview the report (yes) or Printit (no) or cancel the action (cancel).

Get the response and act accordingly.
Yes would Preview the report, No will Print it and cancel will do nothing.

If you want to record somewhere the report was printed, then you could add code related to the original response or ask another question, only if No was selected, for confirmation the print did not fail and if so, record the fact in a table.

This could all be done in 10 or so lines of vba.

I can post some sample code if you wish.
 
Thanks for the offering PNGBill

I just might have to do it this way, I just wanted to always preview the report and then after user sees the report give them the opportunity to print it if they need to when closing. They may only need to look at it and save trees.

It's just beyond me why it can't be printed from the Report_Close event. I really don't want to make the user decide if they want to print it before they view it. The good news is, they will always be able to just preview the first time they click print button and then after report closes they can click it again and choose to print this time. That's doable I guess.

Anyway Thanks again. I can simplify my work here by not trying to be too fancy.

Wally
 
You can call the report's Print method but the report MUST be open before it can be printed. Being open doesn't mean it has to be visible by the way.
 
:)
I have decided to go in the direction that PNGBill suggested. I now have something I can live with.
I actually just added another Menu Item to Preview report ONLY, and one to just Print. So, user can click Preview and check it out or Print to just print. That way I have no trouble capturing that it was printed and make another button visible on Switchboard Form.

Thanks for the help vbaInet, it's all info that I'll surely use down the road. Always willing to learn more ways to skin this cat.

Wally
 

Users who are viewing this thread

Back
Top Bottom