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

Problem with Report layout

Status
Not open for further replies.

ElleNewUser

Programmer
May 17, 2006
4
IE
I am trying to create a report to produce a customer statement. The data is all appearing correctly and is totalling as required. My problem is getting the data to appear in the correct places.

Eg.

A customer statement can be more than 1 page and at the top of every page I want the customer name, address, account number and date to appear so I am placing this data in the page header section and this is working fine.

In the detail section I have all my transactional data appearing such as invoice no, product code etc.

The problem I'm running into is at the end of the statement I have a section on Account summary which gives the opening balance, debits, credits and closing balance.
I only want this to appear on the last page of the statement (if the statement is more than 1 page long) but I don't know how to do this. I want this to appear right at the end of the report which I could put into the page footer and this would work fine for any customer whose statement is only 1 page long but for multiple page statements it will print the account balance at the bottom of each page which is not what I require.

Any help would be great.
Thanks,
Elle
 
You can add code in the On Format event of the Page Footer section like:
Code:
   Me.txtOpeningBalance.Visible = ([Page] = [Pages])
You can use similar code to cancel the printing of the page footer on all but the last page.

This code requires that you bind [Pages] to a control on 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]
 
Hi,

How do I bind the pages to a control?

thanks for your help,
Elle
 
Add a text box to your page header or footer with a control source of:
="Page " & [Page] & " of " & [Pages]

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]
 
Ya sorry I had already done this and it worked perfectly when I used your initial code in the OnFormate event in the page footer.

thanks for your help.
 
Hi, Just one more issue. I will be printing all these statements together for all 100 customers but the problem now is that instead of the account summary printing at the end of each customer statement, it is only printing on the last page that is printed as this is the last page.
I need it to print a balance at the end of each customer statement whether it's 1 page long or 4 pages.

I think I may need to do something with filters perhaps?
Any help would be much appreciated.
Elle
 
Consider using a group footer and using the sample in this KB article on [blue] How to Print a Group Footer at a Specific Location [/blue]


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]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top