S
Scott
I have the below code in the detail format event in my report. It works
fine, evaluates if data exists in the subreport and hides/shows myTxtLabel
depending on the existance of subreport data.
However, if I change the name of the subreport to any other name, this code
gives an error "Access can't find the field 'myReportSub' referred to in
your expression."
I always open the report in design view and change the subreport's name
before trying to run it, but Access refuses to run my code with any changes
to the subreport.
Is there any other way to test if a subform contains data or doesn't? I just
need to show/hide a label when data exists or doesn't.
CODE *********
Private Sub Detail1_Format(Cancel As Integer, FormatCount As Integer)
Me.mytxtLabel.Visible = Reports![myReport]![myReportSub].Report.HasData
End Sub
fine, evaluates if data exists in the subreport and hides/shows myTxtLabel
depending on the existance of subreport data.
However, if I change the name of the subreport to any other name, this code
gives an error "Access can't find the field 'myReportSub' referred to in
your expression."
I always open the report in design view and change the subreport's name
before trying to run it, but Access refuses to run my code with any changes
to the subreport.
Is there any other way to test if a subform contains data or doesn't? I just
need to show/hide a label when data exists or doesn't.
CODE *********
Private Sub Detail1_Format(Cancel As Integer, FormatCount As Integer)
Me.mytxtLabel.Visible = Reports![myReport]![myReportSub].Report.HasData
End Sub