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

No Report Header on Last Page

Status
Not open for further replies.

Tekhelpnet

Technical User
Oct 9, 2007
63
US
How do I prevent information in Report Header to be printed on a last page? Thanks
 
You should be able to check for [page] = [pages] in the header format event.

The early bird may get the worm, but the second mouse gets the cheese in the trap.
 
Specifically, the [red]Report Header[/red] should only display on the first page. To remove the [red]Page Header[/red] from the last page of the report, try code in the On Format event of the Page Header section like:
Code:
Cancel = ([Page] = [Pages])
You may need to add page and pages to a control in your report.

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]
 
Good call again Duane. Never saw the " = = " syntax. I would have done an IF [page] = [pages].....
Is this documented anywhere in Acc help (couldn't find it)?
Using Acc 2k2 if it matters.
Thanks!
[cheers]

Always remember that you're unique. Just like everyone else.
 
The "Cancel" method (or whatever it is called) expects either a True or False following its "=". I often abbreviate my code down using this method (probably at the expense of readability).
Code:
Cancel = ([Page] = [Pages])
is the same as
Code:
If [Page] = [Pages] Then
   Cancel = True
 Else
   Cancel = False
End If

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]
 
Gotcha. Missed the parens the first time around. Didn't know that this could evaluate to a boolean.
Thanks again - always nice to have another trick in the bag...

[cheers]

Always remember that you're unique. Just like everyone else.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top