Page breaks depending upon changed value in a field

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

Guest

I am doing a directory for my grandson's grade school. When a new page is
printed, it prints a page header record that displays the first letter of the
student's name and some clip art.. So you know if you are in the As, Bs,
Cs, etc. However, if the As end and the Bs begin in the middle of the page,
I want to either print a page header record with a B, or force a page break
and have the page header print with a B. The page break is my second choice
because we are trying to minimize the number of pages. But at this point, I
will settle for either.
 
I am doing a directory for my grandson's grade school. When a new page is
printed, it prints a page header record that displays the first letter of the
student's name and some clip art.. So you know if you are in the As, Bs,
Cs, etc. However, if the As end and the Bs begin in the middle of the page,

I like easy ones. although your terms are mixed up, I think you want
either the column heads to print with the B or to force a new page and
start the B's. Here goes...
I want to either print a page header record with a B,

Put your columns heads into the Group Header instead of or as well as,
the page header.
or force a page break and have the page header print with a B.

Go back to your Report Design, open the Menu->View->Sorting & Grouping
dialog box and you will see the bottom line there is called "Keep
Together". Choose which of the other two options suit you best,
"First Detail" or "Whole Group"


Cheers,
Brett
 
Hi Brett,
Thanks for the info. Glad to cheer you up with an easy one! But I need a
little more information. I did not create this database or the report from
it. A parent did it for me. Although I am a complete beginner with Access,
my professional background is computers as a programmer. I've developed
applications with relational databases, so I understand the concepts but not
the specifics and syntax of Access. The report is not formatted in columns.
Looking at the report in design view, there are 5 sections. The first is a
page header that has two lines. The second section says "MasterParent_Group#
Header" with one line. The third is the detail section. It prints one line
for each student linked to the parent. The fourth is "MasterParent_Group#
Footer." It has 3 lines, one for each parent with their info and another
line of images used as a visual separator. The last is a page footer with
two lines including the page number. In pseudo-code my first choice of what
I want to do is:

Read parent record.
If the first letter of the student's last name has changed or top of page
write the page header
else
write the 2nd section (MasterParent_Group# Header)
write a 3rd section (detail) for each student linked to parent
write th 4th section (MasterParent_Group# Footer)
End if
If end of page
write page footer
go to top of page
End if

My second choice of what I want to do is:

Read parent record.
If the first letter of the student's last name has changed
write page footer
go to top of page
end if.
If top of page
write the page header
End if
Write the 2nd section (MasterParent_Group# Header)
Write a 3rd section (detail) for each student linked to parent
Write th 4th section (MasterParent_Group# Footer)
If end of page
write page footer
go to top of page
End if.

So, assuming I didn't screw up the Boolean logic, can you tell me how to do
this? Please don't assume I know how to do anything. Thanks.

Colorado
 
Yes, many professional programmers have made a good living with that sort of
sequential logic.
Unfortunately for them, it's a bit difficult to apply that sort of thinking
to Access, which tends rather to process records less as individual records
and more as groups.
Here's how I would present Access logic as I understand it:
You need another grouping, based on the first letter of the student's last
name.
To do this, first open the query on which the report is based, and add a
new field, something like this:
FirstLetter:Left([LastName],1)
(of course if the Last Name field is named something else, you'll use
that.)
Now open the report in Design View.
At the top, find the Sorting and Grouping button (it's got a lightning
bolt on it, and is next to the Key button.)
Use this to open the Sorting and Grouping Dialog.
Add a line for your new FirstLetter field.
In the properties (at the bottom of the Dialog), set GroupHeader
to Yes.
set the sort order to Ascending.
When you close this box, you'll see you have a new section in your
report, probably named "FirstLetter Header".
Cut all the controls in the Page Header and paste them into this new
header.
In the Property Sheet for this section, set RepeatSection to Yes, so
that it will repeat (with its current values) at the top of any page where
it would not automatically appear.

You may want to delete the PageHeader section, as you won't need it now.

Yes, it feels a lot different from the Boolean logic, but it can also work
quite well!

HTH
- Turtle
 
OK Colorado, still not too hard; If you'd followed the steps I
detailed, you should have all the information and solutions before
you. You haven't really given me a hint as to why they didn't work.

What we are doing is copying the Page header items to the Group
Header. I just assumed they headed columns, they usually do. If it's
not that, what is it?

I assume the Master Parent Group Header has just one text box with a
ControlSource something like;

=Left([Lname,1])

That's what gives you the letter B and breaks the group. Add below
that any other information you want to go with the Group heading and
you have your solution.

Cheers

Brett

Hi Brett,
Thanks for the info. Glad to cheer you up with an easy one! But I need a
little more information. I did not create this database or the report from
it. A parent did it for me. Although I am a complete beginner with Access,
my professional background is computers as a programmer. I've developed
applications with relational databases, so I understand the concepts but not
the specifics and syntax of Access. The report is not formatted in columns.
Looking at the report in design view, there are 5 sections. The first is a
page header that has two lines. The second section says "MasterParent_Group#
Header" with one line. The third is the detail section. It prints one line
for each student linked to the parent. The fourth is "MasterParent_Group#
Footer." It has 3 lines, one for each parent with their info and another
line of images used as a visual separator. The last is a page footer with
two lines including the page number. In pseudo-code my first choice of what
I want to do is:

Read parent record.
If the first letter of the student's last name has changed or top of page
write the page header
else
write the 2nd section (MasterParent_Group# Header)
write a 3rd section (detail) for each student linked to parent
write th 4th section (MasterParent_Group# Footer)
End if
If end of page
write page footer
go to top of page
End if

My second choice of what I want to do is:

Read parent record.
If the first letter of the student's last name has changed
write page footer
go to top of page
end if.
If top of page
write the page header
End if
Write the 2nd section (MasterParent_Group# Header)
Write a 3rd section (detail) for each student linked to parent
Write th 4th section (MasterParent_Group# Footer)
If end of page
write page footer
go to top of page
End if.

So, assuming I didn't screw up the Boolean logic, can you tell me how to do
this? Please don't assume I know how to do anything. Thanks.

Colorado

Cheers,
Brett
 
Back
Top