Creating a report that show limited numbers of record.

J

JoyJoy329

I'm a self learn Access Beginner and currently I'm creating a database for my
company that needs to create a report that shows 23 records per-page. and in
the same time, once the page are over, i what to show the page heading
again.. can anyone help me with this? (the report is created base on a query
that allows the us to input the period of days we wants to show in the
report. eg. input 7= from today - a week later, what we have to delivery to
the customer.
 
D

Duane Hookom

If you always want a page break after 23 records, you can try:
Add a page break control at the bottom of the detail section
Name the page break control "PgBrk"
Add a text box to the detail section of the report:
Name: txtCount
Control Source: =1
Running Sum: Over All
Visible: No
Then add code to the On Format event of the detail section:
Me.PgBrk.Visible = (Me.txtCount Mod 23 = 0)
 
J

JoyJoy329

Hi Duane,
I did able to do what you stated in the thread. but as soon as i try to see
the actual report, access keeps telling me that the function me can't be find
and open "me"
 
D

Duane Hookom

I expect you entered a line of code into the Property of the On Format. I
should have been more clear that the Me.PgBrk.Visible .... goes into the
module of the report. The actual property should state:
On Format: [Event Procedure]
You can then click the [...] button to the right of the property to open the
code window. That is where you enter the Me.PgBrk.Visible....

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.PgBrk.Visible = (Me.txtCount Mod 23 = 0)
End Sub
 

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