Cancel Header / Footer

Posted on 2004-11-14
Last Modified: 2008-03-06

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
Question by:Petrobras
    LVL 33

    Expert Comment

    by:Mike Eghtebas
    Use Report Header instead of Page Header.  Would that do?
    LVL 33

    Expert Comment

    by:Mike Eghtebas
    Or, other way around, to make it work on all pages transfer it to page header from report header.  
    LVL 16

    Expert Comment

    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
    LVL 16

    Accepted Solution

    The real question is, which pages do you wish to cancel - and why?

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
    In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
    In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
    With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now