ForceNewPage on Form With Code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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.)
 
Back
Top