ForceNewPage on Form With Code

D

DDBeards

I have a program that uses the following code:

Reports(stDocName).GroupHeader0.Visible = False
Reports(stDocName).GroupFooter2.ForceNewPage = 1

The first line works great (stDocName is the report name since this is used
for all reports) but the second line generates the Application - Defined
error. I have tried several different formats but to no success. Please
Help Again!

Chris
 
A

Allen Browne

In what event are you trying to do this?

You can set these properties in the *Format* event of the section, or a
prior section (such as the Report Header's Format event.)

You will not be able to run this code after the event has fired. To be safe,
set the Visible property of GroupHeader0 in its Format event.

If you cannot get the FormNewPage to work in the Format event of
GroupFooter2, an alternative approach would be to add a Page Break control
to the section, and set the Visible property of that control.

(It also helps if you mention your Access version when you post a question.)
 

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

Similar Threads


Top