No print option in report preview window

I must be stuck on stupid today...
I'm at a client site, working on an Access 2007 application I wrote many years ago.
A report is opened from a form. The report opens OK, it displays on the screen in its own window. But there's no option to print the report(?) The only thing it appears I can do is close the window. I thought there used to be a command button to print the report. What am I missing?
This is the command I am using to open it (The report name is loaded to variable strRpt):

DoCmd.OpenReport strRpt, acViewPreview, , , acDialog
LVL 7
shambaladAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Trent SmithCommented:
Private Sub ButtonName_Click()
DoCmd.OpenReport "ReportName", acViewNormal, "", "", acNormal
End Sub
Of course you can add to the code, in fact some report codes will filter the report, change formating if certain things are true or not, print a copy then send another copy to an e mail address, print a number of copies with different headers or footers, etc. etc. the list is almost endless.  

Private Sub ButtonName_Click()
'do something here before the report is printed
DoCmd.OpenReport "ReportName", acViewNormal, "", "", acNormal
'do something here after the report is printed
End Sub
for example (I know it's a silly example :-)

Private Sub ButtonName_Click()
If MsgBox("Are you sure you want to print the report?", _
vbQuestion + vbYesNo) = vbYes Then
DoCmd.OpenReport "ReportName", acViewNormal, "", "", acNormal
End If

By the way I love the opening comment.
Jeffrey CoachmanMIS LiasonCommented:
With the new "Ribbon", (Access 2007 and newer) the Print icon will appear on the ribbon when the report is opened
Jeffrey CoachmanMIS LiasonCommented:
print-report.png
Acronis True Image 2019 just released!

Create a reliable backup. Make sure you always have dependable copies of your data so you can restore your entire system or individual files.

Jeffrey CoachmanMIS LiasonCommented:
Oh, I see, you are specifying that the report be opened in "Dialog" Mode.
<DoCmd.OpenReport strRpt, acViewPreview, , , acDialog
I don't see why this is needed.
If you open the report as a dialog box it will suppress any needed toolbars.

If you just open the report in Print Preview, the Print options will appear on the Ribbon (as in my screenshot above.)
    DoCmd.OpenReport strRpt, acViewPreview

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
shambaladAuthor Commented:
Thank you for the responses. I had a feeling I was missing some obvious points. I will be back there at the site tomorrow morning. I'll close out the question then.
Todd
shambaladAuthor Commented:
As you point out, Jeff, the reason I am seeing the report in a window with no options is because the report has been opened using the acdialog option. Unfortunately, this is 'by design'.
This application was originally written back in 2002 using Access 2000. It's actually pretty complex, and large. It has many forms, reports, queries, etc.
As I recall, one of the design issues was maintaining the 'precedence' of the forms. That is to say; some of the operations may go 4 or 5 forms deep. If the user was on the 5th opened form, we had to ensure they didn't click back to the 3rd opened form without closing the 5th, then the 4th forms first. As a result, each of the forms is opened in dialog (and, I'm thinking maybe modal) mode. Yes, it's kind of klugey, but the whole package actually 'works' pretty well, and has so for many years now.
Anyway, because of this, the only way to get the report to open in a window in front of the form where the command to run the report has been clicked is to open it using the 'acdialog' option.
If I remove the 'acdialog' option, the report can be viewed, but the user has to close a couple of forms to actually get to that window (whereupon they have the ribbon options to print).
That may be the way I have to go here.
However...
When I wrote this app, I put a wrapper/function on the OpenForm so that I could dynamically change the parameter defaults from a single data point. I'm going to play with this a little and see if I can't find another way through this.
I am actively working on this problem, and will close this quesion sometime today.
Thanks,
Todd

A developer's lament/digression:
This app has become something of a maintenance nightmare for me. It needs to be re-written.
At one point, I started doing a re-app for 64-bit, and in no time found myself butt deep in alligators, so to speak. Really don't want to re-visit that swamp.
The app has extensive links to Excel, which wasn't an issue until they started to upgrade MS Office in piecemeal fashion. This is app is being run on PCs, any of which may have installed Office 2007, 2010 or 2013. Even changing all the references to late-binding won't be trivial.
shambaladAuthor Commented:
I'm removing the acdialog option from OpenReport.
Thank you for your assistance.
Todd
Jeffrey CoachmanMIS LiasonCommented:
A quick workaround might be to add a button directly on the report to Print it out.
Then open the Report in "Report View".
 
You must set the: "Display When" property of the button to: "Screen Only" so that the button appears on the report (so you can click it), ...but it will not appear on the actual Printout (hard-copy)

Sample attached
Database891.mdb
shambaladAuthor Commented:
That's a really good idea. Thank you. I'm going to give that a try when I'm back in the office Monday morning.
Thanks again.
Todd
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.