How do I keep individual controls or groups together in reports

G

Guest

I am trying to keep the contents of a text box from splitting over two pages
in a report. I have a large amount of fields in my Report Footer and it's not
practical to set the whole Report Footer section to 'keep together' or 'force
new page' as I want it to flow on straight after the Detail section ends.
Does anyone know a way I can do this and also possibaly even keep a small
group of controls together and from appearing on different pages as well? So
in effect I have "sub-sections" in my report?

Also, I know you can limit Page Footers to appear relative to the appearance
of Report Footers & Report Headers on a page, but is there a way you can
limit your Page Footer section to only appear on a particuar page? ie. such
as limiting it to the second last page - where [Page]=([Pages]-1)

Help on any of these would be greatly appreciated
 
M

Marshall Barton

Jon22 said:
I am trying to keep the contents of a text box from splitting over two pages
in a report. I have a large amount of fields in my Report Footer and it's not
practical to set the whole Report Footer section to 'keep together' or 'force
new page' as I want it to flow on straight after the Detail section ends.
Does anyone know a way I can do this and also possibaly even keep a small
group of controls together and from appearing on different pages as well? So
in effect I have "sub-sections" in my report?

Also, I know you can limit Page Footers to appear relative to the appearance
of Report Footers & Report Headers on a page, but is there a way you can
limit your Page Footer section to only appear on a particuar page? ie. such
as limiting it to the second last page - where [Page]=([Pages]-1)


Since there is no KeepTogether property for individual
controls, you have to use more sections where you can
specify the property.

To simulate the report footer (but not full width in
multi-column reports), you can create top level groups on a
constant expression such as =1. You can then place your
group of controls into their own section. Same for the long
text box. Just don't get carried away with this because you
can only have ten group levels.

You can easily hide a page footer by making it invisible
Me.Section(4).Visible = (Page=(Pages-1))
or using Cancel = True in its Format event. However, this
will not make its space available for other use.
 
G

Guest

Thanks for that Marsh, the info makes sense to me but I'm unsure how exactly
to apply it. Where do I actually type the expression Me.Section(4).Visible =
Page = (Pages-1) ?

And regarding the grouping, I'm unsure as to how I create the top level
groups. Does it matter that none of the controls that I'm trying to group are
linked to any fields in the underlying table? They are mainly the results of
expressions.

Marshall Barton said:
Jon22 said:
I am trying to keep the contents of a text box from splitting over two pages
in a report. I have a large amount of fields in my Report Footer and it's not
practical to set the whole Report Footer section to 'keep together' or 'force
new page' as I want it to flow on straight after the Detail section ends.
Does anyone know a way I can do this and also possibaly even keep a small
group of controls together and from appearing on different pages as well? So
in effect I have "sub-sections" in my report?

Also, I know you can limit Page Footers to appear relative to the appearance
of Report Footers & Report Headers on a page, but is there a way you can
limit your Page Footer section to only appear on a particuar page? ie. such
as limiting it to the second last page - where [Page]=([Pages]-1)


Since there is no KeepTogether property for individual
controls, you have to use more sections where you can
specify the property.

To simulate the report footer (but not full width in
multi-column reports), you can create top level groups on a
constant expression such as =1. You can then place your
group of controls into their own section. Same for the long
text box. Just don't get carried away with this because you
can only have ten group levels.

You can easily hide a page footer by making it invisible
Me.Section(4).Visible = (Page=(Pages-1))
or using Cancel = True in its Format event. However, this
will not make its space available for other use.
 
M

Marshall Barton

Apparently, you don't have any grouping in your report yet
;-)

Use the Sorting and Grouping window (View menu) to specify a
group. Just enter =1 in the top row's Field/Expression and
then enter Yes in the Group Footer row in the lower part of
the window.

You can then split your controls across the group footer and
the report footer. You may even want to add another group
using another constant expression (e.g. =2) to get a third
section.

And, No, it doesn't matter if the controls are bound or
unbound or whatever.

I don't know enough about what you have going on in your
report to be sure where you want to make the page footer
invisible, but using the page footer section's Format event
procedure is probably a safe place.
--
Marsh
MVP [MS Access]

Thanks for that Marsh, the info makes sense to me but I'm unsure how exactly
to apply it. Where do I actually type the expression Me.Section(4).Visible =
Page = (Pages-1) ?

And regarding the grouping, I'm unsure as to how I create the top level
groups. Does it matter that none of the controls that I'm trying to group are
linked to any fields in the underlying table? They are mainly the results of
expressions.

Jon22 said:
I am trying to keep the contents of a text box from splitting over two pages
in a report. I have a large amount of fields in my Report Footer and it's not
practical to set the whole Report Footer section to 'keep together' or 'force
new page' as I want it to flow on straight after the Detail section ends.
Does anyone know a way I can do this and also possibaly even keep a small
group of controls together and from appearing on different pages as well? So
in effect I have "sub-sections" in my report?

Also, I know you can limit Page Footers to appear relative to the appearance
of Report Footers & Report Headers on a page, but is there a way you can
limit your Page Footer section to only appear on a particuar page? ie. such
as limiting it to the second last page - where [Page]=([Pages]-1)
Marshall Barton said:
Since there is no KeepTogether property for individual
controls, you have to use more sections where you can
specify the property.

To simulate the report footer (but not full width in
multi-column reports), you can create top level groups on a
constant expression such as =1. You can then place your
group of controls into their own section. Same for the long
text box. Just don't get carried away with this because you
can only have ten group levels.

You can easily hide a page footer by making it invisible
Me.Section(4).Visible = (Page=(Pages-1))
or using Cancel = True in its Format event. However, this
will not make its space available for other use.
 

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