Hi
I'm using Access 2003.
Thanks to MajP I was able to create a report where header fields are visible or not depending on whether there is data for the month selected.
I added vertical lines to the report and was able to make the lines invisible in the group header and footer sections based on the same information MajP gave me. For the footer I used:
MajP also gave me the following code for the detail sections for data fields that are empty:
The problem with using the same code for the detail section is that if there is data for the whole month but no data for one of the groups then a vertical line doesn't show up for that group and I don't get a solid line for the entire detail section which is what I want.
What do I need to do so the line is solid in the detail section? Thanks.
I'm using Access 2003.
Thanks to MajP I was able to create a report where header fields are visible or not depending on whether there is data for the month selected.
I added vertical lines to the report and was able to make the lines invisible in the group header and footer sections based on the same information MajP gave me. For the footer I used:
Code:
Private Sub ReportFooter_Format(Cancel As Integer, FormatCount As Integer)
Me.ln1_C.Visible = Not IsNull(Me.qryM2_A_Cases)
Me.ln2_C.Visible = Not IsNull(Me.qryM3_A_Cases)
Me.ln3_C.Visible = Not IsNull(Me.qryM4_A_Cases)
Me.ln4_C.Visible = Not IsNull(Me.qryM5_A_Cases)
Me.ln5_C.Visible = Not IsNull(Me.qryM6_A_Cases)
Me.ln6_C.Visible = Not IsNull(Me.qryM7_A_Cases)
Me.ln7_C.Visible = Not IsNull(Me.qryM8_A_Cases)
Me.ln8_C.Visible = Not IsNull(Me.qryM9_A_Cases)
Me.ln9_C.Visible = Not IsNull(Me.qryM10_A_Cases)
Me.ln10_C.Visible = Not IsNull(Me.qryM11_A_Cases)
Me.ln11_C.Visible = Not IsNull(Me.qryM12_A_Cases)
End Sub
MajP also gave me the following code for the detail sections for data fields that are empty:
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim ctl As Access.Control
For Each ctl In Me.Controls
If ctl.Tag = "?" Then
ctl.Visible = Not IsNull(ctl)
End If
Next ctl
End Sub
The problem with using the same code for the detail section is that if there is data for the whole month but no data for one of the groups then a vertical line doesn't show up for that group and I don't get a solid line for the entire detail section which is what I want.
What do I need to do so the line is solid in the detail section? Thanks.