[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Viewing report before printing using DoCmd.Printout

Posted on 2006-06-08
Medium Priority
Last Modified: 2008-02-01
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.
Question by:moyedokun
  • 2
LVL 11

Expert Comment

ID: 16862766
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.
LVL 61

Accepted Solution

mbizup earned 1500 total points
ID: 16862806
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.
LVL 34

Expert Comment

ID: 16862976
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.

LVL 34

Expert Comment

ID: 16863059
Retract....I have experimented with an API in VB6 to do the button on a report, but not in Access.

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Suggested Courses
Course of the Month19 days, 14 hours left to enroll

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question