I have a report and in that report I have a continuous subreport.
they are linked by roomnumber (master/child)
The subreport can have anywhere from 0 to 10 records (each record has 5 textboxes with diffeent values).
In the main report, I also have ten textboxes.
If the subreport does not have any records, I want to hide all textboxes,
If the subreport has one record, I want to show Textbox1 and hide textbox2 through textbox10.
If the subreport has two records then show textbox1 & 2, and so on.
Also, if say I have one record, then I only show textbox1, I would like to have this textbox equal to one of the textboxes in the subreport record.
I have tried using this code to loop through the all controls in subreport, but it does not work,
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
For Each ctl In Me.Controls
if not isnull(ctl) then
do not hide
else: hide
End If
Next ctl
End Sub
When i loop through this code, it seems to repeat the same record.
Any direction would be great
they are linked by roomnumber (master/child)
The subreport can have anywhere from 0 to 10 records (each record has 5 textboxes with diffeent values).
In the main report, I also have ten textboxes.
If the subreport does not have any records, I want to hide all textboxes,
If the subreport has one record, I want to show Textbox1 and hide textbox2 through textbox10.
If the subreport has two records then show textbox1 & 2, and so on.
Also, if say I have one record, then I only show textbox1, I would like to have this textbox equal to one of the textboxes in the subreport record.
I have tried using this code to loop through the all controls in subreport, but it does not work,
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
For Each ctl In Me.Controls
if not isnull(ctl) then
do not hide
else: hide
End If
Next ctl
End Sub
When i loop through this code, it seems to repeat the same record.
Any direction would be great