vba MS Access Force 报告页脚到页面底部

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2611007/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-11 11:32:09  来源:igfitidea点击:

MS Access Force report footer to bottom of page

ms-accessvba

提问by Icode4food

I am trying to make a report for a proposal. I would like to keep a professional look and always force the terms section to the bottom of the page. I could use the page footer but I only want the terms to show on the last page.

我正在尝试为提案做报告。我想保持专业的外观,并始终将条款部分强制到页面底部。我可以使用页脚,但我只希望条款显示在最后一页。

My idea is somehow with VBA to set the height of a dummy group such that it forces the report footer to the bottom. The problem is that you can't explicitly set the height of a section.

我的想法是用 VBA 以某种方式设置虚拟组的高度,以便它强制报告页脚到底部。问题是您无法明确设置部分的高度。

Anyone else out there with another idea (That works)? :-)

还有其他人有其他想法(有效)?:-)

Thanks, Jeff

谢谢,杰夫

采纳答案by Icode4food

This did the trick for me:

这对我有用:

Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As Integer)
Me.PageFooterSection.Visible = (Me.txtPage <> Me.txtPages)
End Sub

Thanks for your help.

谢谢你的帮助。

回答by BenV

Here's an idea:
http://bytes.com/topic/misc/answers/499733-report-footer-location-problem#post1939746

这是一个想法:http:
//bytes.com/topic/misc/answers/499733-report-footer-location-problem#post1939746

To accomodate single page reports you could do something like

要容纳单页报告,您可以执行以下操作

If Me.Pages > 0 Then
Me.Section(4).Visible = (iif(Me.Pages = 1, True, Me.Page = Me.Pages))
EndIf

Note that Access only calculates the number of pages if you have page numbers on your report. If you don't want them displayed you can set their Visible property to False.

请注意,如果报表上有页码,Access 只会计算页数。如果您不想显示它们,您可以将它们的 Visible 属性设置为 False。