Hide detail section when subreport doesn't have data

  • Thread starter brazellt via AccessMonster.com
  • Start date
B

brazellt via AccessMonster.com

Hello all,

New to Access monster, not to MS Acess...however, this situation is trying to
become a monster for me. Scenario: I have what seems to be a simple report
setup with a main report, a subreport in the detail section, and another
subreport in a footer section. All works well, except I've been trying, to
no avail, to use the hasdata property for hiding the detail section when the
subreport in the detail section doesn't have data. It still shows all main
records in the detail section. I'm using me.detail.visible = me.detailsub.
hasdata. At first, no change in data printed, now I'm getting a runtime error
'438' that states the object doesn't support this property or method.

Any help would be greatly appreciated.

Thank you in advance,
TB
 
M

Marshall Barton

brazellt said:
New to Access monster, not to MS Acess...however, this situation is trying to
become a monster for me. Scenario: I have what seems to be a simple report
setup with a main report, a subreport in the detail section, and another
subreport in a footer section. All works well, except I've been trying, to
no avail, to use the hasdata property for hiding the detail section when the
subreport in the detail section doesn't have data. It still shows all main
records in the detail section. I'm using me.detail.visible = me.detailsub.
hasdata. At first, no change in data printed, now I'm getting a runtime error
'438' that states the object doesn't support this property or method.


You are referring to the subreport **control** when you need
to refer to the report object that the subreport control is
displaying.

Try this syntax:

Me.Detail.Visible = Me.detailsub.Report.HasData
 
B

brazellt via AccessMonster.com

Thank you Marshall Barton, that did it. I appreciate the speedy reply...
thanks again.

Marshall said:
New to Access monster, not to MS Acess...however, this situation is trying to
become a monster for me. Scenario: I have what seems to be a simple report
[quoted text clipped - 5 lines]
hasdata. At first, no change in data printed, now I'm getting a runtime error
'438' that states the object doesn't support this property or method.

You are referring to the subreport **control** when you need
to refer to the report object that the subreport control is
displaying.

Try this syntax:

Me.Detail.Visible = Me.detailsub.Report.HasData
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top