Limit Number of Records Per Page - Access Report

Hi,

I have a list of tutors,  each tutor has taught a number of hours.  Some teachers have 10 hours and some others have more than 50.  The Official form has a place for only 15 hours, "Date, Sign, remarks".

I designed (imitated) the form in Access,  it looks fine.

Now how can I limit each form to 15 records or less. If Dr. X has 10 hours,  they can fit in one form,  if Dr. M has 52 hours,  I want the hours to be printed on 4 forms. Also when the Teacher's name changes a new form should begin.

Thanks a lot
LVL 14
hhammashAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

nico5038Commented:
The codeless solution would be to manipulate the header/footer and detail section so only 15 rows are printed.
For skipping per teacher select the teacherID (Name?) as a grouping when creating the report or by pressing the [= looking button. The indicate a Header is needed for the teacher and add the teacher field(s) to that section.
You can also indicate that the section needs to be repeated and that a pageskip is needed in the properties of the header section (click the header bar).

Nic;o)
0
harfangCommented:
Hello,

I think that Nico's advice is sound. If you have imitated a printed form, there should be room for exactly 15 rows, not more. If everything else is repeated on each page, you should be fine.

For reference, this is how to force a page break after 15 rows even if there is room for more. It uses a text box with control source: =1, and running sum: over group, called txtRowCount, which can be hidden:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    If txtRowCount Mod 15 = 0 Then
        Detail.ForceNewPage = 2   ' after section
    Else
        Detail.ForceNewPage = 0   ' none
    End If
End Sub

Cheers!
(°v°)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
hhammashAuthor Commented:
Thank you guys,

I'll try the suggestions.

Nico!
I used the header and footer to display the fixed parts of the form. The details section will have the data.  How to mainpulate the details section to print only 15 records without coding?

Thanks
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

nico5038Commented:
Just make the height to fit 15 rows.
Optionally you can increase the header of footer by dragging the "bar" or the lowest border of the footer to limit the detailsection size.
Perhaps you can add a line to show the start and end of the detailsection to show the header and footer sections when "tuning" the report on paper.

Nic;o)
0
hhammashAuthor Commented:
Hi,

The details section will grow with the data,  if I have 50 records the details section will grow.  Can I make it fixed in design?
0
harfangCommented:
Hello,

Textboxes, some other controls, and sections have a .CanGrow property. If you choose No, their size is fixed. It is even possible to have growing textboxes on a non-growing section, at the risk of loosing some data if the text is too long. This is used for example on mailing labels.

Cheers!
(°v°)
0
hhammashAuthor Commented:
Hi harfang,

The CanGrow property in the details section is already No,  it is this way from the beginning.



0
hhammashAuthor Commented:
Hi harfang,

I tried your code,  the field with source =1 and running sum= over group is a great idea.  I did some adjustments to suite my application.

It is working perfectly.

Thanks a lot
0
harfangCommented:
I'm gald you it worked for you.
Good luck with your project!
(°v°)
0
hhammashAuthor Commented:
Thank you both
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.