How to hide empty sub-reports

  • Thread starter Thread starter chrisloudon
  • Start date Start date
C

chrisloudon

Guest
I am quite new to Databases and am wondering if there is anyway to hide (in form view) a subreport when there is no data to show. I have created a database listing music album data and have 2 subreports from 2 queries that list the track titles from both disc 1 and disc 2(if any) of albums. I would like the subreport for disk 2 to hide its self when the album doesnt have more that 1 disc.

Any ideas.

Thanx.
 
I just ran into this code today, so I have not tried it myself.

Place the following code in the "On Current" event of the main form.


Private Sub Form_Current()
With Me![SubformName].Form
.Visible = (.RecordsetClone.RecordCount >1)
End With
End Sub

Let me know if it works
 

Users who are viewing this thread

Back
Top Bottom