Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

page break on a report after 22 records 2

Status
Not open for further replies.

Mack2

Instructor
Joined
Mar 12, 2003
Messages
336
Location
US
I need a page break on a report after 22 records. So when record 23 hits, that record should be the first record on the next page. Any Ideas???? Thanks in advance!!!!
 
I posted this in response to your original post in the other topics forum...

Add a report group for some unique index in your dataset, set Group Footer to Yes, Group On to interval, and Group interval to 22. Then, in the group footer, add a page break control.
 
The options for the Group On does not have "to interval" available. It has each value and Prefix Characters. Any ideas??????????
 
I would add a text box to the report detail section
[tt][blue]
Name: txtCount
Control Source: =1
Running Sum: Over All
Visible: No
[/blue][/tt]
Add a page break control to the bottom of the detail section:
[tt][blue]
Name: PgBrk
[/blue][/tt]

Then add code to the On Format event of the detail section:
Code:
Me.PgBrk.Visible = Me.txtCount Mod 22 = 0


Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Rjoubert...Thanks, but that will not work because I would have to create a subgroup for the item. So it will create a page break for every item. I first group by customers, so I added a group for part id.
 
dhookom... Thanks your code makes sense, but I am getting a compile error for mod 22. What is the reason for the mod 22 code.
 
Try this...

Me.PgBrk.Visible = (Me.txtCount Mod 22 = 0)

 
Me.txtCount Mod 22 returns you the remainder when the value in txtCount is divided by 22.

You could also try...

If Me.txtCount Mod 22 = 0 Then
Me.PgBrk.Visible = True
Else
Me.PgBrk.Visible = False
End If
 
Thanks rjoubert! The if statement worked

If Me.txtCount Mod 22 = 0 Then
Me.PgBrk.Visible = True
Else
Me.PgBrk.Visible = False
End If

Thanks Again!!!!!
 
dhookom...have to throw a star your way, since you came up with the mod 22 idea.
 
Sorry dhookum, I should have given you a star also.Thanks for your help. Thanks rjoubert for pointing that out.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top