Sorting and Grouping - Changed Behaviour in Access 2003 versus 200

J

john

I believe the behaviour of Sorting and Grouping has changed from Access 2000
to Access 2003. I have a report with a Sub-Report in the Page Footer of the
main report. The Sub-Report uses the Link Child Fields and Link Master Fields
properties to determine the content of the sub-report in the page footer.
When the field values change and the page footer prints - the values in
Access 2000 that are still active for the page are those of the last record
of the current group. When the same report is run for the same data in Access
2003 the values for the page footer are no longer the values of the last
record of the current group but instead are now the first record of the next
group. Has anyone else seen this behaviour ??
 
A

Allen Browne

Hi John.

Values in the page footer have never been reliable, so what you describe may
well be the case.

The Detail section of a report refers to a particular record reliably, and
so does any Group Header (first record of the group) or Group Footer (last
record of the group.) But the Page Footer section has no connection to a
particular record. Instead it is related to the space on the page.

When Access plans the page, the space available is the page height, less top
and bottom margins, less the height of the Page Header and Page Footer, so
not it starts fitting stuff into that space. How it fits them depends on the
properties of the sections, such as Visible, Height, and KeepTogether. It
may depend on the actual data for the record too if CanGrow or CanShink is
set. If the section is a Grouping, you can also instruct it to keep the
whole group together, or at least keep the header with the first detail
record (bottom of Sorting'n'Grouping dialog.) To make it even more messy,
you can programmatically set the report's runtime properties (such as
NextRecord, MoveLayout, and PrintSection), which again affect how all the
previous properties are respected in executing a solution for the page.

It is therefore entirely possible that Access loads records, and has to
backtrack because it discovers there is no solution that respects that
combination of properties without moving to a new page. So, what is the
"current" record when this happens? Is it the last record that did fit? Or
the record that we currently can't fit? Do you see that the concept of
"current record" is undefined in the Page Header/Footer sections, and in
practice can vary between versions?

Hope that helps you understand at least what's going on in this case when
Access is not giving the behavior you expect.
 

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