Solved

Why does print preview lock up and not allow me to navigate the report pages while in preview?

Posted on 2015-01-22
8
844 Views
Last Modified: 2015-01-28
In Access 2007, I have a report on which I put three buttons, Save (to pdf), Close, and Print. The print is actually mapped to open in print preview. This was because the report contains a lot of information on one page, yet the person needed bigger font. Print Preview has a scroll bar to to magnify the information. My thought is to eliminate the ribbon from the users' view so that they have less options to mess with the database design, otherwise I would direct people to the print preview in the ribbon.

When I open in Print Preview, the view ceases to respond to the mouse and only by clicking on something else, like the task bar, and then coming back to the print preview screen, can I then navigate the print preview pages and other toggles. Is there some setting or coding to overcome this obstacle? The report print preview opens with an embedded macro, but I could switch that to VBA. But if the answer is in VBA, you'd need to walk me through it miniscule step by step.

I do now see at the bottom right of the screen that there is another magnifying glass, which is actually a print preview button, so I might just direct users to that.

But, if I can get the report print preview button to work without locking up the view navigation, I think that would be the best route for our users.
0
Comment
Question by:David Bigelow
  • 4
  • 3
8 Comments
 
LVL 74

Expert Comment

by:Jeffrey Coachman
Comment Utility
Also confusing is this:
I have a report on which I put three buttons, Save (to pdf), Close, and Print.
This seems to be the reason for the odd behavior.
(I was able to recreate)

Why not open the report from a "form"
Then all should function normally

Am I not understanding something?
Why pen a report in Report View, ...just to reopen the report in Print Preview?

JeffCoachman
0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 500 total points
Comment Utility
Oh...

Try changing your code to something like this...
    DoCmd.Close acReport, "YourReportNameHere"
    DoCmd.OpenReport "YourReportNameHere", acViewPreview

....this seems to avoid this issue.
Let me know
;-)

JeffCoachman
0
 
LVL 84
Comment Utility
My thought is to eliminate the ribbon from the users' view so that they have less options to mess with the database design, otherwise I would direct people to the print preview in the ribbon.
A better way to do this would be to provide the user with your own custom ribbon, which includes those commands you want the user to interact with.

See this site for a great tool for working with the ribbon: www.ribboncreator.com
0
 
LVL 1

Author Comment

by:David Bigelow
Comment Utility
Jeff: see question below.

Scott: Love the idea. Nearing publishing deadline, I don't want to start a new idea.

Jeff: This close/open code works great for one report, but the second report is generated from a form of four comboboxes for a total of 16 different possibilities of reports, based on the various usages or non-usages of the comboboxes.

Is there a way I could have this code requery the source form for it's current parameters listed in the comboboxes?

I'm not familiar enough yet with looping, so on my form I made a series of 16 conditions in the macro tool with all the possible null/not null scenarios available for the four comboboxes. The report is generated off those scenarios, based on which condition was matched.

So, I would need something that would requery that form before opening the report in print preview. The form is "frm_TrainingByEe", with two tabs: "sfm_Shifts_Banks" and "sfm_Sups_Ees". Each tab has four comboboxes and the report is generated from one tab or the other, not both. To me, it is interesting to note that the way I could differentiate between the two tabs in the macro conditions was by referencing the form and then differntiating any similar combo boxes with '_2'. I couldn't do it by referencing the subform. For example,

[Forms]![frm_TrainingByEe]![cbo_Supervisor_2] Is Null And [Forms]![frm_TrainingByEe]![cbo_Last_Name] Is Null And [Forms]![frm_TrainingByEe]![cbo_Flow_ID_2] Is Null And [Forms]![frm_TrainingByEe]![cbo_Queue_ID_2] Is Not Null

I could just have the report open in print preview, but personally, that is not pleasant. The report is more pixellated and you have to click on the little page forward arrow to navigate instead of using page up/down or mouse scroll. Page up/down won't advance to next page in preview. I'm just wanting a simplistic way to access print preview for those who want to magnify the report.
0
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 74

Expert Comment

by:Jeffrey Coachman
Comment Utility
This close/open code works great for one report, but the second report is generated from a form of four comboboxes for a total of 16 different possibilities of reports, based on the various usages or non-usages of the comboboxes.Is there a way I could have this code requery the source form for it's current parameters listed in the comboboxes?
This seems to be unrelated to your original question:
Why does print preview lock up and not allow me to navigate the report pages while in preview?
So to be clear, ...did my modified code address your first question?

To briefly address your new concern here, ...whenever you issue the Docmd.openreport command, the report is reopened, thus it's recordsource will be refreshed.
So I am not quite sue whey you are having issues with this (unless I am not understanding the way you are doing things)
0
 
LVL 1

Author Comment

by:David Bigelow
Comment Utility
Thank you, Jeff. Yes, the modified code addressed the first question, specifically. The first report opens directly: there are no variable parameters associated with opening the report. I can navigate in print preview freely. Hurray!

The second report is opened based on conditions specified in combo boxes on a form. Your modified code calls up and opens the second report directly, without, I think, first looking through the comboboxes on the form for any information that should be filtered out. Here's why I think that.

If in the combo boxes, I filter to select Team H, and run the report, only Team H and their training records are shown. It's about 3 pages long. Then, using your modified code behind the print button on the report, I hit print and the report opens in print preview, but it is 63 pages long - all employees and their training are listed, not just Team H. My guess is that the modified code doesn't look at the parameters in the combo boxes, just opens the full report.

The inability to navigate is addressed, I can now navigate the second report in print preview. Besides that, I need the report to open in print preview as it was filtered to open as first specified from the comboboxes.

Edit: I'm thinking about your comment regarding the record source. Here's a copy of that attached. It seems that the Filter is removed when I close and reopen the report with your code, while the record source remains. Here's the Filter from the Data tab of the Report properties; it is the matching code of one of the 16 iterations: [Bank]=[Forms]![frm_TrainingByEe]![cbo_Bank]

Bank refers to Team. In this scenario, the Bank combo box I used to specify Team H.

Edit 2: I don't understand. When I went to print preview using your code and checked the report properties, the filter was still there and was the same. Not sure why it's not showing as filtered in preview.
Report-Record-Source.PNG
Report-Filter.PNG
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
Comment Utility
If your original question has been addressed, then you should assign points to this question and post your new concerns as a new question(s).
This will give a fresh set of Experts a shot at assisting you.
I will watch for your new posts as well
;-)

JeffCoachman
0
 
LVL 1

Author Closing Comment

by:David Bigelow
Comment Utility
If the report is opened up directly, this works. When I opened a report that was filtered by combo boxes on a form and the macro builder was set to comb through the form filters, first, this solution, though it addressed the freezing issue, did not cause the report to be opened with the macro conditions that would have filtered the report. It simply opened the full report.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

762 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

12 Experts available now in Live!

Get 1:1 Help Now