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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ForceNewPage in VBA from a form 1

Status
Not open for further replies.

batteam

Programmer
Sep 12, 2003
374
US
I need to run a report two differentways: one way is a record on each page, the 2nd is running all records together on the same page. Any assistance on how the ForcedNewPage method can be programmed using VBA from the form (Access 2000) that controls running the report would be appreciated (or, I understand that ForcedNewPage can be coded behind the report itself). Would not want to build two different reports if a guy doesn't have to.

Thanks for any assistance you can offer.
 
Add a check box "chkBreakPages" to your form.

Place a pagebreak control at the very bottom of the section where you want the break. Name the control something like "pgbrk".

Then add code to the On Format event of the section containing the pagebreak control to something like:

Me.pgbrk.Visible = (Forms!frmMyForm!chkBreakPages=-1)

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]
 
Thanks so much for the info. Works great - only had to tweak the code behind the report to reflect the '.value' of the chkbreak control on the form and not hard code it to -1.

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top