Viewing report before printing using DoCmd.Printout

I have a report that when viewed - the message box opens that asks a user if they want to print the report.  Then once the report has printed another message box appears that asks if the users wants to update the record.  That works fine but the problem is that when the user views the report the message box automatically appears and it does not allow the user to view the report or zoom in or out because the message box is displayed.  Is there anyway to allow the user to view and then come back to the message box or is there a way to run code after a person clicks on File - Print.  That way I can take the message box out and have the update code to run after a person Prints the file.

Also, is there anyway to pull up the print preview/properties dialog box using a DoCmd.Printout or how is that done.
moyedokunAsked:
Who is Participating?
 
mbizupCommented:
You can use the following command (instead of Docmd.Printout) to bring up the print dialog box:

DoCmd.RunCommand acCmdPrint

Is the doCmd.printout executed when the report is opened?  Maybe you could use a custom print button in a commandbar so that the user can print the report at will.  I'll give more details if you are interested in going that route.
0
 
EMCITCommented:
Message Boxes are modal, which means that once they are open no other form or object can receive the focus until the message box is dealt with. I don't believe this setting can be altered (but I may be wrong). You may need to create your own message box in a form, which you can set the modal property to NO. That way you can toggle focus between the message box and the report.
0
 
jefftwilleyCommented:
You can Put a control on the report itself maybe in the header section...a print button and maybe a cancel button. Set their properties to not print when you do print the report. Use their on_click events to prompt you to save the record.

J
0
 
jefftwilleyCommented:
Retract....I have experimented with an API in VB6 to do the button on a report, but not in Access.
J
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.