The main report group header is the training session
information (subject, instructor, etc.). Each session is
a record in the sessions table. The main report detail
section is a subreport that lists attendance at the
training session. The subreport lists name and date of
everbody who attended the training session. Each
name/date is a separate record in a junction table that is
between the sessions table and an employees table. The
main report is grouped by the PK (SessionID) from the
sessions table. At first I did not group at all, but
instead inserted a page break after the subreport. It
looks something like this:
Main Report Page Header
___________________________
Main Report Group Header
Subject
Instructor
Department
etc.
NAME DATE (column labels for the subreport)
____________________________
Main Report Detail Section
Subreport
Name Date
Name Date
______________________
Subreport Report Footer
______________________________
Main Report Page Footer
Repeat Section is set to Yes in the group header. When I
print I get the Main Report's page header and Group Header
on each page. The subreport's report footer appears at
the end of the subreport, as intended. The Main Report's
page footer appears on each page, as intended. When the
list of attendees runs onto a second page, the second page
looks just like the first.
I have a few other settings such as forcing a page break
to make the formatting work properly.
This might be a complete hash from your point of view, but
it seems to work. One thing I might change is to have
less information at the top of the second page when two
pages are necessary to list all of the attendees at a
training session. Maybe the second page would just
contain "[Subject], continued" or something like that,
then the column headings for Name and Date, and a
continuation of the attendance listing.
I sometimes wonder how much detail to put into my
questions. In this case it seems that a bit more would
have helped.
-----Original Message-----
Bruce wrote:
Thanks again for taking the time to help. I have to say
that something about the suggestion is not making
sense
to
me. I tested it a bit, and could not get the number in
txtCounter to increment (I made it visible to test it).
Perhaps if I put the subreport into the group header
rather than the detail section, so that txtCounter is the
only thing in the detail section? As it is now, with the
subreport in the detail section, txtCounter only shows up
once, no matter the length of the subreport. In other
words, it shows up at the end of the subreport with the
number 1 in it, no matter how many pages the subreport
occupies. For now other matters are demanding my
attention, so I will not have a chance to experiment
further for at least a few days, but I have saved the
suggestion to my personal Help files for reference
when
I
can get back to it.
Time out. You seem to have placed the running sum text box
in the main report, when I had intended it to be in the
subreport. From the way I read your question, there
was
no
changes to make to the main report. I thought the group
header that you're trying to manipulate is in the subreport.
Was that correct or is it a main report header of some kind?
-----Original Message-----
Bruce wrote:
Thanks, that was the missing link. What I had before
was
the training session information (subject, instructor,
department, etc.) in the main report's detail section.
Grouping was by the Session PK. The subreport, listing
attendance, date, etc. was also in the detail section.
The column labels were in the subreport's report
header.
(I could not get the subreport's page header to show up
at
all). After reading your reply, I moved the session
information to the group header, along with the column
labels, and changed the Repeat Section property to Yes.
The subreport remained in the main report's detail
section. That did what I needed. I would have
preferred
that only selected information about the session appear
on
the second page, similar to how a page header can be
made
not to appear with the report header, but that level of
refinement does not seem to be readily available for
group
headers. However, it is not really a problem. Your
reply
allows me to move past formatting problems so that I can
get back to work on information management, which is
after
all the whole point of the project.
If you want the group header to look different on the
first
occurance and subsequent occurances, then you can use VBA
code in the group header's Format event to make some of
the
header controls invisible and use CanShrink to reduce the
space the header occupies.
First you need a way to determine when the header is
starting the group and when it is just repeating on
additional pages of the group. Then is easily done by
adding an invisible text box named txtCounter to the
detail
section. Set it's control source expression to =1 and
RunningSum property to Over Group.
Then you can make the session text boxes visible or
not
as
needed:
Dim bolFirst As Boolean
bolFirst = (Me.txtCounter = 1)
Me.sessionA.Visible = bolFirst
. . .
Me.sessionZ.Visible = bolFirst
Make sure the session text box's and the header section's
CanShrink properties are all set to Yes.
.