访问报告:每个详细信息的第二页上的页眉

发布于 2024-11-04 09:54:06 字数 296 浏览 0 评论 0原文

我只想在第二页及之后的每条记录上显示标题。新详细信息的首页不应显示页眉。

最初我有以下代码

Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As Integer)
    Me.PageHeaderSection.Visible = Not (Me.Page = 1)
End Sub

,它在除第一个页面之外的所有其他页面上显示标题。

我希望标题在每个组的第一页(但不包括第一页)之后可见。

I want to display a header only on the second page and beyond but PER record. The first page of the new detail should not have the page header visible.

Originally I had the following code

Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As Integer)
    Me.PageHeaderSection.Visible = Not (Me.Page = 1)
End Sub

It displays the header on everyother page except the first.

I want the header to be visible after the first page (but not including the first page) for each group.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

全部不再 2024-11-11 09:54:06

太复杂了。

第一个更好!

Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As Integer)

    Me.PageHeaderSection.Visible = Not (Me.Page = 1)
    Debug.Print "Page " & Me.Page & " Visible = " & Not (Me.Page = 1)

End Sub

Way too complicated.

The first one was better!

Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As Integer)

    Me.PageHeaderSection.Visible = Not (Me.Page = 1)
    Debug.Print "Page " & Me.Page & " Visible = " & Not (Me.Page = 1)

End Sub
温馨耳语 2024-11-11 09:54:06

在报表的排序和分组中,添加标识记录和要分组的字段。在该节标题的 OnFormat 事件中,执行与上面相同的操作:RecordHeader.Visible=(Me.Page<>1)

In the Sorting and Grouping for the report, add the field that identifies the record and that you want to group on. In the OnFormat event of that section header, do the same thing you're doing above: RecordHeader.Visible=(Me.Page<>1)

一花一树开 2024-11-11 09:54:06

我创建了这个简单的子程序,似乎可以解决问题。基本上,对于每个页面,它都会检查该组是否与以前相同。如果不同,则假定它是该组的第一页并且不显示标题。

'At the top of the module window I created a "Module-Level Variables".
Dim current_group As Integer
Dim temp_group As Integer

Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As Integer)

    current_group = Int(Me.MyGroupID)

    If current_group = temp_inst Then
        Me.PageHeaderSection.Visible = True
    Else
        Me.PageHeaderSection.Visible = False
    End If

    temp_group = current_group    
End Sub

I created this simple sub that seems to do the trick. Basically, for each page, it checks if the group is the same as before. If it is different it assumes that it is the first page of the group and doesn't display the header.

'At the top of the module window I created a "Module-Level Variables".
Dim current_group As Integer
Dim temp_group As Integer

Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As Integer)

    current_group = Int(Me.MyGroupID)

    If current_group = temp_inst Then
        Me.PageHeaderSection.Visible = True
    Else
        Me.PageHeaderSection.Visible = False
    End If

    temp_group = current_group    
End Sub
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文