在报告中,我有一个grouptxt。在打开时,我试图操纵一些标签。当Rit = 0时,标签和txt应该为true或false(请参见下文)。但这不起作用。
Private Sub Groepskoptekst1_Format(Cancel As Integer, FormatCount As Integer)
If Me.Rit = 0 Or IsNull(Me.Rit) Then
Me.lblDatum.Visible = True
Me.Datum.Visible = True
Me.Rit.Visible = False
Me.lblRit.Visible = False
Me.GeenRit.Visible = True
Me.Traject.Visible = False
Me.lblKm.Visible = False
Else
Me.lblDatum.Visible = True
Me.Datum.Visible = True
Me.Rit.Visible = True
Me.lblRit.Visible = True
Me.GeenRit.Visible = False
Me.Traject.Visible = True
Me.lblKm.Visible = True
End If
End Sub
部分格式事件仅在打印或打印预览视图中运行。 –安德烈
如果要在“报告视图”中打开报告,则需要将代码移至On Load
事件。