将报告切换到打印预览会锁定Access! [英] Switching report to Print Preview locks up Access!

查看:62
本文介绍了将报告切换到打印预览会锁定Access!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个报告,我在报告视图中打开,但我希望用户能够切换到打印预览。所以我有一个预览命令按钮带有一个非常简单的事件过程:

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:

展开 | 选择 | Wrap | 行号

推荐答案

假设这个cmdPreviewButton在表单上,​​只要你将焦点移到此表单上,您不再拥有Active报表(必须将焦点放在活动状态)


所以您需要做的是查看哪个报表已加载,以及prevew

Assuming this cmdPreviewButton is on a form, as soon as you move the focus to this form, you no longer have an Active report (That must have the focus to be active)

So what you have to do is see which report is Loaded, and prevew that

展开 | 选择 | Wrap | 行号


但不,cmdPreviewButton不在表单上,​​它在我想要预览的报表上因此仍然有重点。它是该报告上的三个按钮之一(它们仅显示在报告模式中,或者当前,而不是打印预览中)。其他的是cmdPrint和cmdClose,两者都可以正常工作。 (cmdPrint运行一个输入框来询问你想要多少个副本,然后调用DoCmd.Printout,而cmdClose显然只是执行DoCmd.Close)。事实上,所有三个按钮都按照预期进行操作,但预览一个按钮也几乎冻结了窗口。 (我说差不多,因为F11和Ctrl-G键仍然可以工作,报告仍然可以用鼠标滚轮滚动。但是我没有点击任何工作!
But no, the cmdPreviewButton is not on a form, it is on the report which I want to preview and which therefore still has the focus. It is one of three buttons on that report (they only appear in Report mode, or course, not in Print Preview). The others are cmdPrint and cmdClose, which both work fine. (cmdPrint runs an Inputbox to ask how many copies you want, then invokes DoCmd.Printout, and cmdClose obviously just does DoCmd.Close). In fact all three buttons do what they''re supposed to, but the Preview one also almost freezes the window. (I say "almost" because the F11 and Ctrl-G keys still work, and the report can still be scrolled with the mouse wheel. But nothing I click on works!


嗯,我从来没有把按钮放在报告上,我的直觉是这是个坏主意。我对它们中的任何一个都有用感到有些惊讶。报告是一张等待打印的纸。


功能区涵盖了你想要的一切(虽然不是很整齐)所以我建议你看一下定制的丝带


Phil
Well, I''ve never put buttons on a report, and my gut feeling is that it''s a bad idea. I am somewhat surprised that any of them work. A report is a piece of paper waiting to be printed.

The ribbon covers all that you want (albeit not very neatly) so I suggest you have a look at a customised ribbon

Phil


这篇关于将报告切换到打印预览会锁定Access!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆