setting visible for subreport conditionally

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello

I'm preparing a report in Access 2000 (sort of a product catalog). Grouping in done on product ranges (trade names). The group header includes two subreports (one displaying a memo field containing general information on the product range and its use, the other listing available technical literature for the product range in question; both subreports use the main reports' full width). Data for the report as well as both subreports comes from tables (generated from "tailor-made" queries to suit requirements -- language and application industry for the product ranges). All tables include the product range index which makes up the link fields from the main to the subreports. Both subreports can grow and shrink. So far so good, works fine

Depending on the number of records within a given product range index, the detail section will continue on another page. I need the group header to display the subreports only once (on the "first" page), not on subsequent pages of the same range index. My problem: So far I have managed to set Visible to False but have not managed to set Visible back to True for the subsequent group change (only for the one following that), and I get a blank area the size of the subreports on the "first" page (example: for one group, the subreports take up nearly the whole page, leaving room for three records; on the next page, again there is only room for three records plus a giant blank space above them). I tried to control this in the group header's and footer's format and print events

Has anyone got a solution to this? Thanks a lot in advance for your support
 
Ecpfeifer,

Check the Repeat Section property of the group header section. Sounds
like it is set to Yes and it should be No.
 
Ecpfeifer,

Ok, here's how I think I would handle this. Leave the group header's
Repeat Section property set to No. Put the column headings in the group
header and also in the page header. On the Print event of the group
hader, put this code...
Me.Section(acPageHeader).Visible = True
.... and in the Print event of the group footer, put...
Me.Section(acPageHeader).Visible = False
 
Steve,

thanks so much for the help so far, I really appreciate it. Your suggestion did the trick -- almost. After I put the column headings into the page header as well, they will show every time, also above the subreports where they shouldnn't. The page is laid out this way:

Page header: Title (visible at all times)
column headings (should only be visible when the subreports should not)

Group header: subreport 1 (visible only when group changed)
subreport2 (ditto)
column headings

The problem now is: I need to set the page header column headings to Visible = False on group change & page break and to Visible = True on page break & no group change. Have you got an idea? Thanks in advance.

Regards
Eberhard


----- Steve Schapel wrote: -----

Ecpfeifer,

Ok, here's how I think I would handle this. Leave the group header's
Repeat Section property set to No. Put the column headings in the group
header and also in the page header. On the Print event of the group
hader, put this code...
Me.Section(acPageHeader).Visible = True
.... and in the Print event of the group footer, put...
Me.Section(acPageHeader).Visible = False
 
Eberhard,

My earlier suggestion was already designed to take care of this. Did
you put Me.Section(acPageHeader).Visible = False on the Print event of
the group footer? (If you haven't got a grop footer, put one in... you
don't need to put any controls in it). What this *should* do, assuming
you have it set up to start a new Group on a new page, is when it gets
to a group footer, it indicates obviously that one group has finished
and another one about to begin, so page header is hidden, and then,
after the group header is printed, the page header is set to visible
again, ready for the next page.
 
Back
Top