Report formatting

  • Thread starter Thread starter Sjanlaird
  • Start date Start date
S

Sjanlaird

Guest
I'm setting up a report to print off several customer statements. For a given customer, the statement may be several pages long and I begin a new page for each customer. I need to show a total figure on the final page for each customer.
The problem is, how to put the total figure in the same place on each statement - I have a sum in the group footer, but depending where the detail lines finish this may be displayed half way down the page.
I have used the OnPage event to draw a number of formatting lines. Can I use a similar solution (maybe setting the Top property of the textbox) to position my total, or is there some other approach?
Also, does anyone have any ideas about page numbering over the statement? I Would need the page number to reset for each new customer.
 
I'm not sure about that one, but I'll give it a try.

What about doing a printing loop in VBA:

Code:
Private Sub cmdPrintReport_Click()
On Error GoTo Err_cmdPrintReport_Click

    Dim stDocName As String
    Dim stLinkCriteria As String
    
    stDocName = "MyReport"
    For CustomerNumber = 1 to NumberOfCustomers
        stLinkCriteria = "[Customer] = CustomerNumber"
        DoCmd.OpenReport stDocName, , , stLinkCriteria
    Next CustomerNumber

Exit_cmdPrintReport_Click:
    Exit Sub

Err_cmdPrintReport_Click:
    MsgBox Err.Description
    Resume Exit_cmdPrintReport_Click
End Sub
You would have the page numbers reset for each customer and could put your sums in the report footer.
 
Unknown variable

In the for loop you refer to the variable 'NumberOfCustomers', where does this come from as it is never declared nor initialized in the sample code given
 
I'm not quite sure, but it could be a field from your query, where you count the customers, or you could use recordsets with 1 to EOF.
I just gave an idea!
I'm not sure about that one, but I'll give it a try.
Not even sure how it works, but the loop seemed logical.
Newman

Sparx > If I remember your thread, it was used with a number of stores. If it is always the same number of stores, you could use a (Constante??? Not sure about the english term! ie: kind of variable but with a fixed value)
 
Strange how answering posts here encourage you to work on problems of your own that you've put on the back shelf, try this
 
Last edited:

Users who are viewing this thread

Back
Top Bottom