Viewing report before printing using DoCmd.Printout

Posted on 2006-06-08
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
    LVL 11

    Expert Comment

    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

    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

    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

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

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    In the previous article, Using a Critera Form to Filter Records (, the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
    Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
    What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

    745 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

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now