I am having some problems getting my report to format properly. The report consists of 110 2-page records, but on some records, I need to hide certain fields and replace them with a field that says no data is available. For example, in the code below, Graph110 is a horizontal bar graph that need to appear on 100 of 110 records. In the other 10 records, I have no data for the graph and would rather not have the empty graph showing.
Here is the code I have for the event procedure in the On Format event of the Detail section of my report:
It seemed to be working at one time. I think the problem started when I added Label160 to be shown only when Unavailable is not Null. Anyhow, the problem I am experiencing now is that all the Visible properties work for the every instance of Unavailable IsNull, but only the FIRST instance of Unavailable not IsNull. Shouldn't my code be getting checked for every record?
Here is the code I have for the event procedure in the On Format event of the Detail section of my report:
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If IsNull(Unavailable) Then
Me.Label160.Visible = False
Me.Text127.Visible = True
Me.Graph110.Visible = True
Me.GraphHeader.Visible = True
Me.Significant.Visible = True
Me.Aptitudes.Visible = True
Me.Significant.Visible = True
Me.Unavailable.Visible = False
Else
Me.Label154.Visible = False
Me.Label136.Visible = False
Me.Label139.Visible = False
Me.Label160.Visible = True
Me.Text127.Visible = False
Me.Graph110.Visible = False
Me.GraphHeader.Visible = False
Me.Significant.Visible = False
Me.Aptitudes.Visible = False
Me.Significant.Visible = False
Me.AptitudeList.Visible = False
Me.Unavailable.Visible = True
End If
End Sub