|
8金钱
我使用了代码来动态设置报表的纸张及边距,但出现一个奇怪现象
打开报表时, 代码是执行了,但没有任何效果,可是手工打开页面设置, 发现里面的设置内容的确按代码已经修改了,如果这时按一下确定, 报表纸张设置才有效果
在Open事件中加了如下代码:
Dim rs As Recordset
Set rs = CodeDb.OpenRecordset("Select * From tblrptPageSize ", dbOpenDynaset)
With Me.Printer
.PaperSize = Nz(rs!rptPageSize, 9)
.TopMargin = Round(Nz(rs!rptTop, 0) * 56.7, 2)
.BottomMargin = Round(Nz(rs!rptBottom, 0) * 56.7, 2)
.LeftMargin = Round(Nz(rs!rptLeft, 0) * 56.7, 2)
.RightMargin = Round(Nz(rs!rptRight, 0) * 56.7, 2)
.Orientation = 2
.Copies = 1
End With |
|