Only show a subreport under certain circumstances?

  • Thread starter TonyWilliams via AccessMonster.com
  • Start date
T

TonyWilliams via AccessMonster.com

I have a report (rptlinesbycountry) that is run twice a year in June and in
December which includes a date control txtmonth (I realise the txt prefix is
a little misleading but the field is definately a date field). The report
contains a sub report (rptlinesbycountryYTD) that I only want to be shown
when the report is run in Decemeber. How do I code the report for that to
happen?
Thanks
Tony
 
M

Marshall Barton

TonyWilliams said:
I have a report (rptlinesbycountry) that is run twice a year in June and in
December which includes a date control txtmonth (I realise the txt prefix is
a little misleading but the field is definately a date field). The report
contains a sub report (rptlinesbycountryYTD) that I only want to be shown
when the report is run in Decemeber. How do I code the report for that to
happen?


Use the Format event of the section containing the
subreport:

Me.subreportcontrol.Visible = (Month(Date) = 12)

Make sure the subreport control and its section both have
their CanShrink property set to Yes.
 
T

TonyWilliams via AccessMonster.com

Thanks Marshall that worked just fine.
Tony

Marshall said:
Use the Format event of the section containing the
subreport:

Me.subreportcontrol.Visible = (Month(Date) = 12)

Make sure the subreport control and its section both have
their CanShrink property set to Yes.
 

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