Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Making report elements visible based on a field value

Status
Not open for further replies.

dfwelch

Programmer
Dec 5, 2003
51
US
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:
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
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?
 
Never mind. Stupid moment! I forgot that I had not yet updated all 10 Unavailable fields, just the first one for testing purposes. LOL, man, I FEEL DUMB!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top