Avatar of amkbailey
amkbaileyFlag for United States of America asked on

Print last page first Access 2000 Report

Does anyone know how to have an Access report print the last page first and then print the rest of the report or have the pages print in reverse? Either through Access properties or programatically.

I have a report with totals in the report footer and they want that page printed out first.
Microsoft Access

Avatar of undefined
Last Comment
Hamed Nasr

8/22/2022 - Mon
Jim Dettman (EE MVE)

<<Does anyone know how to have an Access report print the last page first and then print the rest of the report or have the pages print in reverse? Either through Access properties or programatically.>>

  Afraid there is no way to do this easily.

  The only approach I can think of is to force the report engine into two pass mode (reference the pages property on the report), pickup the totals from the footer on the first pass and save, then on the second pass, push the saved values into unbound controls at the start of the report.

  This technique is used commonly to place calculations or text else where in a report, provide a table of contents or index, or create groups with a "page x of y" over each group.

  If you want to give this a go, bounce back and I'll fill in more details.

JimD.
ASKER CERTIFIED SOLUTION
Jim Dettman (EE MVE)

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Mike Eghtebas

boag2000,

I am know to take difficult routes oncw in a while.

Mike
Jeffrey Coachman

Mike,

<I am know to take difficult routes oncw in a while.>
LOL
;-)
Me too!

You should have seen my sample *before* I trimmed it down!
It was a monster!, I was loading Temp tables via Recordsets.

Enjoy the weekend!
;-)

Jeff
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Jeffrey Coachman

hnasr,

Yes, the key word there is "Some"! (not all)
;-)
Besides they would always have to remember to toggle it on or off depending on any other print jobs.

What I posted should work regardless of the printer, so they can print this on any system they like.

BTW: isn't it funny that you can't type "9 to 1" in the print dialog box and have it print backwards?
Grrr!

I even thought that the PrintOut Command would let us "developers" print backwards, but no-go.
;-(

Jeff
Hamed Nasr

<:-(
toggle off - toggle on
isn't it funny ?>
Attacking comments!
Is this allowed in this site?
Jeffrey Coachman

hnasr,

I think you took my comment the wrong way.
I was just making the observation that if someone did have a printer that printed in reverse order, that they would have to remember to turn it off for normal printing.

No offense was meant
;-)

The "isn't it funny" comment was just meat to say that it would have been nice if MS let programmers print in reveres from the PrintOut command.

Again, no offense should have been taken

Sorry for any mis-understanding.

JeffCoachman
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Hamed Nasr

boag2000,
No problem! Thanks :-)
ASKER
amkbailey

Thanks for all the help. I'm going to try the code this weekend.
Hamed Nasr

amkbailey,

Just asking for clarification?
For a report of 5 pages, will the required output (using code) be as:
5 1 2 3 4  
or
5 4 3 2 1  
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
Jeffrey Coachman

hnasr,

<For a report of 5 pages, will the required output (using code) be as:
5 1 2 3 4  
or
5 4 3 2 1>

Oy!
Don't make my head explode!
;-)

Jeff
Hamed Nasr

:-)
ASKER
amkbailey

Either way would work I am guessing.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Hamed Nasr

Try this model db
It prints last page first, then rest of pages.

Module: functionToPrintIsHere
Option Compare Database
Function printPage(selPage)
        DoCmd.SelectObject acReport, Reports("report54321").Name, True
        DoCmd.PrintOut acPages, selPage, selPage
End Function


Report: report54321
Form: f0- Buton Print54321
Code:
Private Sub print54321_Click()
    Dim p As Integer
    DoCmd.OpenReport "report54321", acViewPreview
   
    printPage (Reports("report54321").Pages)
    For p = 1 To Reports("report54321").Pages - 1
            printPage (p)
    Next p
    DoCmd.Close acReport, "report54321"
End Sub

Print-last-page-first-Access-200.mdb
Jeffrey Coachman

hnasr,

Isn't this fun!
;-)

Jeff
Hamed Nasr

Yes it is Jeff.
Thanks
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck