使用VBA的MS Access打印报告 [英] MS Access Print Report using VBA
问题描述
我有一份非常详尽的VBA报告.当我预览它时,一切都很好,但是在预览后打印时,它变得古怪.我花了很多时间来缩小可能性范围,并以一定的信心得出结论,它是MS Access中的错误.
I have a very VBA intensive report. When I preview it everything is great but when I print it after previewing things go wacky. I have spent many hours narrowing down the possibilities and I have conclude with a certain level of confidence that it is a bug in MS Access.
到目前为止,我打印报告的方法是使用docmd.openreport "report"
打开报告.然后,我使用docmd.printout
命令,以便可以设置页面范围,排序规则等.
Up to this point my method for printing reports was to open the report using docmd.openreport "report"
. I then use the docmd.printout
command so that I can set the page range, collation etc.
有没有一种方法可以直接打印报告,而无需先进行预览就可以设置页面范围,整理等选项?
Is there a way to print a report directly and still be able to set options like page rage, collate etc without doing a preview first?
谢谢, 杰夫
推荐答案
很久以前,我遇到了一个非常困难的案例.我必须进行一些字段创建,移动和格式化,而这只能以一种方式完成.我采取了大胆的方法,这变成了唯一的方法:我在设计模式下以隐藏状态打开了报表,让vba完成了工作,完成后,报表被更改为普通且可见,以供显示和打印.
long ago, i had a very difficult case. i had to do some field creations, and moving and formatting and this could only be done one way. i took a bold approach and it turned to be the only way: i opened the report hidden and in design mode, had vba do it's stuff, and when done, the report was changed to normal and visible for display and printing.
这篇关于使用VBA的MS Access打印报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!