当报表的属性“HasModule”为true时,使用报表保存打印机设置不起作用 [英] Saving printer settings with report does not work when property 'HasModule' of report is true

查看:111
本文介绍了当报表的属性“HasModule”为true时,使用报表保存打印机设置不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个新的空报告'repTest'以及一个新模块'basTest',它只包含以下代码:

I have created a new empty report 'repTest' as well as a new module 'basTest' which contains only the following code:

Function SetTestReportPrinterBin()
 DoCmd.OpenReport "repTest", acViewPreview, , , acHidden
 Reports("repTest").Printer.PaperBin = 1
 DoCmd.Save acReport, "repTest"
End Function

'SetTestReportPrinterBin'唯一做的就是更改报告'repTest'的打印机仓。

The only thing 'SetTestReportPrinterBin' does is change the printer bin for the report 'repTest'.

只要报告'repTest'将属性'HasModule'设置为'false',一切都按预期工作,报告的打印机文件夹将被更改并与报告一起存储。但是,如果我将属性'HasModule'更改为'true',代码仍会执行
但报告的打印机bin不会更改和存储。当然我需要'HasModule'为'true'。

As long as the report 'repTest' has the property 'HasModule' set to 'false' everything works as expected and the printer bin of the report is changed and stored with the report. However if I change the property 'HasModule' to 'true' the code still executes but the printer bin of the report is not changed and stored. Of course I need 'HasModule' to be 'true'.

要编写上面的代码,我使用了以下信息:http://msdn.microsoft.com/en-us/ library / aa139946%28v = office.10%29.aspx。

To write the code above I used the information found here: http://msdn.microsoft.com/en-us/library/aa139946%28v=office.10%29.aspx.

无论我使用Access 2003(首选)还是访问2007,这个问题都是一样的。

This problem is the same no matter if I use access 2003 (preferred) or access 2007.

有人知道为什么将报告的'HasModule'属性设置为'true'会阻止'SetTestReportPrinterBin'的代码正常工作吗?

Does anybody know why setting the report's 'HasModule' property to 'true' stops the code of 'SetTestReportPrinterBin' to work correctly?

非常感谢,Felix

Many thanks, Felix

推荐答案

当表单/报表背后有代码时,模块设置为true。 该代码中是否有可能影响财产设置的内容? 您是否已逐步执行代码以检查设置是否仍然按照您的要求在整个
执行代码?
Has module is set to true when there is code behind the form/report.  Is there anything in that code that may be affecting the property setting?  Have you stepped through the code to check to see if the setting remains as you want it throughout the execution of the code?


这篇关于当报表的属性“HasModule”为true时,使用报表保存打印机设置不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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