So I had a form that opened a report using a function in another module using DoCmd.OpenReport.
This worked fine and the report popped open and appeared to be the active object on the screen. However, it was not.
The behavior this caused was that when I clicked on the Print button on the Print Preview ribbon, it would not print the report, but the form instead. All other ways of printing the report worked fine: printing from the file menu and printing from the context menu on the report. After digging around on the internet, I found someone else who had the same issue. They tried to get help from a Microsoft support thread which was unable to do so, however one person mentioned that that button on the ribbon prints the active object.
So, after I opened the report in VBA, I found I could add the line:
DoCmd.SelectObject acReport, "TheReportName" |
This would force Access to make the report the Active Object so the Ribbon button would then print that.
Just a little FYI in case you run across the problem in your journeys.