【问题标题】:MS Access: Report SetProperty On Activate does not work, on batch printMS Access:在批量打印时报告 SetProperty On Activate 不起作用
【发布时间】:2023-04-09 17:19:01
【问题描述】:

VBA版本

报告On Activate事件

Option Compare Database
Private Sub Report_Activate()
    If (Me.SomeTextBox = "SomeText25") Then
        Me.SomeLabel.Visible = False
    End If
End Sub

版本

报告On Activate事件

If [SomeTextBox]=SomeText25 Then
    SetPropery
        Control Name SomeLabel
            Property Visible
                Value False
End If

报告预览和打印,从打印预览和报告视图,作为一个单一的报告,但不是在以编程方式打印多个结果时,从相同的查询数据。

Query Criteria: Between...

当报表打印多条记录时,控件在所有打印报表上可见,On Activate 事件被忽略。

看起来我可能必须通过记录集Loop 才能获得所需的结果。

作为一种解决方法,我将Label 转换为TextBox,并使用Conditional Formatting 来隐藏(变白)文本。

【问题讨论】:

    标签: ms-access


    【解决方案1】:

    OnActivate 不会触发正常打印,仅用于预览,因此您必须使用另一个事件。

    【讨论】:

      【解决方案2】:

      将我的If/Then 放入详细信息部分的On Print 事件中,并使用Else 重置它,正确打印所有报告。

      Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)`
          If...Then
              ...Visible = False
          Else
              ...Visible = True
          End IF
      End Sub
      

      【讨论】:

        猜你喜欢
        • 2012-09-20
        • 1970-01-01
        • 2011-01-05
        • 1970-01-01
        • 1970-01-01
        • 2015-12-14
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多