Link to home
Start Free TrialLog in
Avatar of Petrobras
PetrobrasFlag for United States of America

asked on

Cancel Header / Footer

Experts,

The following code is only works for one page and I do not know how to modify the code to make the header or footer disappear for more than one page.  I have tried commas, ands, another line to no avail.

Cancel = [Page] = ? (the ? is the page number)

The code is put in the on format event in the header or footer section.
How can I make this code work for more than one page?

thank you
Avatar of Mike Eghtebas
Mike Eghtebas
Flag of United States of America image

Use Report Header instead of Page Header.  Would that do?
Or, other way around, to make it work on all pages transfer it to page header from report header.  
Avatar of GreymanMSC
GreymanMSC

Canceling a small number of predetermined page numbers:
  Cancel = (Page = 1) Or (Page = 3)

Canceling all even pages.
  Cancel = (Page Mod 2 = 0)

Canceling a large number of predetermined page numbers
  Select Case Page
  Case 1, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43
    Cancel = True
  Case Else
    Cancel = False
  End Select
ASKER CERTIFIED SOLUTION
Avatar of GreymanMSC
GreymanMSC

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial