Full Version: Show totals only on last page
UtterAccess Discussion Forums > Microsoft® Access > Access Reports
bis2k
I have an invoice report that can be several pages. I need to only display the pagefooter section, that contains the totals, on the last page.

I found this code in UA many years ago (I don't remember where).
I set [RowsPerPage] to 11.

It counts the number of rows in the detail section and if there are more than 11 rows the pagefooter is not visible and a new page is created. If there are less than 11 rows the pagefooter is visible.

It works great except when the number of rows in the detail section = 11 (the [rowperpage] value) - then the total doesn't display at all.

Here is the code that controls the display
CODE
If Me![Row] Mod 11 = 0 Then
  Me![DetailPageBreak].Visible = True
   HideFields ' this hides the totals in the pagefooter
     Me!Continued.Visible = True
Else
  Me![DetailPageBreak].Visible = False
    ShowFields ' this displays the totals in the pagefooter
     Me!Continued.Visible = False
End If


I will continue to look for the original UA sample.

I need help to to show totals on the bottom of the last page when the number of rows on that page is exactly equal to the [rowsperpage].

Thanks

Larry
vtd
Check Access VBA Help on the Properties Page and Pages of a a Report.

If Me.Page = Me.Pages Then
' It is the last page
End If
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.