I have a report which I open in Report View, but I want the user to be able to switch to Print Preview. So I have a "Preview" command button with a very simple event procedure:
This works fine, except that having switched to Print Preview I find the entire Access window is frozen. Nothing I right- or left-click on works - including even the Access window close button. F11 and Ctrl-G still work, but even after using them mouse clicks are inactive.
However, if I take the focus off the Access window and back again - either by clicking outside the window and then inside it again, or by Alt-Tab twice - everything becomes OK again.
It makes no difference whether the report is opened initially through VBA or by clicking in the Navigation pane.
(The DoEvents command was added to the Sub in the hope of solving the problem, but it didn't.)
Code:
Private Sub cmdPreviewButton_Click() DoCmd.OpenReport Screen.ActiveReport.Name, acViewPreview DoEvents End Sub
However, if I take the focus off the Access window and back again - either by clicking outside the window and then inside it again, or by Alt-Tab twice - everything becomes OK again.
It makes no difference whether the report is opened initially through VBA or by clicking in the Navigation pane.
(The DoEvents command was added to the Sub in the hope of solving the problem, but it didn't.)
Comment