Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access 2007 Print Preview Freezes Up

Status
Not open for further replies.

bernardb

Vendor
May 22, 2002
5
US
I have a report on which I added Print Preview command button. The On-Click event of the button contains the following code only:

DoCmd.RunCommand acCmdPrintPreview

When the Print Preview is clicked the preview opens as expected but the entire application seems to freeze and Access does not respond to anything on any part of the screen. I have discovered two ways to clear the situation.

1) Bring up the task manager then immediately close it. After this the ribbon buttons become active again and I can close the preview or use the zoom features, etc.

2) Switch to the Access VBA window and click the Reset button. Even though there is no indication in the code window that the code stopped or hit a failure point, this does clear the problem and the report window unfreezes and everything works normally again.

What am I doing wrong?
 
bernardb,

Note that I am not intimately familiar with this command, so take this with a grain of salt.

Is it possible that you're telling Access to CONSTANTLY remain in PrintPreview?

Is there, perhaps, some other place you could put it that wouldn't cause it to always force it to be in PrintPreview?

Just an idea based on the fact that if you Reset your VBA, it fixes the problem.
 
I am having the same problem. I have a report with a button for switching to "print preview". The on-click command for my button is slightly different from that bernardb used:

DoCmd.OpenReport "MyReport", acViewPreview

The view switches to "print preview", and both Access and the VBA window freeze-up solid. Just switching to Task Manager un-freezes access, but since the VBA window is frozen, I can't click the reset button as bernardb is able to do.

A messy workaround is to call a sub in a module which closes the report and re-opens it in print-preview using the very same command that causes Access to freeze.

I guess VB gets confuzzled when a report tries to change its own view. It's a bug, I say!
 
Where is the command button located? from your question it appears that you've put it into the report. This would cause a problem as the preview would be calling itself.

If this is the case take the command button out of the report and place it onto a form. Otherwise use the preview button on the toolbar.
 
The print preview button is located on a seperate form, so that's not the reason. Regardless, I have forms that have buttons to change their own view modes using "docmd.openform", and that works just fine; for some reasons, reports won't have any of it.

My reason for using a clear, labeled button is to make the database simple to use for those who would be reticent to learning the function of all of the tiny-wee un-labeled buttons on their software.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top