Too Many Pages

racer25

Slowly Getting There
Local time
Today, 22:15
Joined
May 30, 2005
Messages
65
Hi

Apologies for the subject difficult to condense.....

The report I have is ran by looping through each client number and outputting a new report for each client. One Query One report multiple client numbers.

The report 95% of the time fits on either on 1 Page or 2 Pages and if it is on 2 Pages it prints on the back of Page 1.

If it goes onto Page 3 I have a problem. These reports all fit in a window envelope which goes into a single page enveloping machine and we now have 2 pieces of paper.

I am not too worried if it prints on three pages but if I could get some report showing

ClientCode ... Pages
Next ClientCode Page

etc....

I would then go and pulll those pages from the pile and envelope manually.

Any help you could offer would be appreciated.
 
You can use the "on close" or maybe the "on page" event to fetch the Page "parameter" from the report.

Me.Page returns the current pagenumber, Me.Pages returns the number of pages in the report
 
Hi Mailman,

Thanks for the above, just done a search for me.pages to see if it would give me a little guidance.

While I see where you are going with your answer I 'll be quite honest don't really have much clue as to what to do with it.

I don't want a message box (if I can avoid it) as I have a 150 per day to print off.

Is there an append query I could generate to record my outputs?

Please treat me a newbie, I do my best to search .....

Appreciate your guidance,

Cheers,

R
 
Do you know how to find the Events and in paricular the "on close" or "On Page" ones??

I am not particularly sure which one you should use... it is either or...

First you need to make a table to store your results in... then find these events, you can put some code... like
Code:
If me.Pages >= 3 then
    ' Store Clientcode in a table
    Dim rs As DAO.Recordset ' <== ***
    Set rs = CurrentDb.OpenRecordset("Select * from YourTable") ' <= **
    rs.AddNew
    rs!Clientcode = Me.Field1 ' <= *
    rs!Pages = Me.Pages ' <= *
    rs.Update
    Set rs = Nothing

end if

This will store only the clientcodes that have more than 3 pages... If you want all clientcodes and pagenumbers... leave away the If and end if lines...

* Addapt column names to your column names
** Addapt the table name, to your table
*** If you get an error on this line have a search on the forum how to "Reference Microsoft DAO" to rectify that situation.
 
Hi Mailman

Thanks for the help so far !

Nearly there I think.

My table is PagesPrinted my colums in that table are

CLI_CLIENTNUMBER Text
Pages Number

I placed the code in the Report Property "On Page" and also tried it "On Close"

Code:
Private Sub Report_Page()
    If Me.Pages >= 0 Then
    ' Store Clientcode in a table
    Dim rs As DAO.Recordset ' <== ***
    Set rs = CurrentDb.OpenRecordset("Select * from PagesPrinted") ' <= **
    rs.AddNew
    rs!CLI_CLIENTNUMBER = Me.CLI_CLIENTNUMBER ' <= *
    rs!Pages = Me.Pages ' <= *
    rs.Update
    Set rs = Nothing

End If
End Sub

On line 2 I have changed that to 0 (could be why it does not work not sure).

The control on my report are called

CLI_CLIENTNUMBER
Pages (with a Control Source =[Page])

When I had number of pages set to 3 nothing was written to the table at all. When I changed it to 0 all records were written however Pages was showing 0 for every record.

I hope I have given you enough info and appreciate your time.

Cheers,

R
 
If you want all remove the if and end if lines.. or do >= 0 that should report all...
It should also report the number of pages correctly... I have no clue why it doesnt.

Accoording to the Access help it is available in both Preview AND printing. I have no problems with this in preview, maybe the problem is with printing?? I dont know, but I dont have a bunch of reports to print at the moment to test it for you :(

What version are you using??
 
Sorted !!!!

Have to some playing around I got it working. Pure fluke I think but both controls had to be in the same section....

I am using 2007.

Thanks for all your help.
 
I dont use 2007, but 2002... so that may be the cause for the discripantie :(

Backwards compatibility is a rare thing now a days :(
 

Users who are viewing this thread

Back
Top Bottom