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

Invoicing system - Different first page - print preview problem

Status
Not open for further replies.

julietita

IS-IT--Management
Aug 11, 2008
1
0
0
US
Hi,
I am trying to build an invoicing system in Access 2003. Eventually, I would like to retrieve data from a server, populate tables, preview and print invoices. I have managed to do everything except the preview part.
An invoice has the following properties:
- all pages have the same header (company logo and contact details + customer name and address)
- the first page contains a stub that the customer will cut and send back to us with a check
- the first page can contain 12 records maximum (because of the stub)
- the following pages can contain 24 records each
Users will have access to a form to select the invoices they want to print preview and/or print.
What I have done so far is create a report that contains all the objects I need (logo, stub, 24 textboxes). I have put everything in the detail section. Then, in the code, I fill in the pages and hide objects I do not need depending on the page I am on. Once a page is full, I programatically print it (using DoCmd.OpenReport).
The problem if I do that is that when I hit print preview I only see the last page of the invoice as I am constantly deleting and rewriting on the same page.
So I have changed my report and I am now using a subreport to display only the records. This subreport is based on a query that retrieves all the records for this invoice and is contained in the detail section of the report. The idea here is to change the height of the subreport if I am on another page than the first one. The thing is, I do not see how I can count pages.
I thought I could create a query that returns only 12 records (using the SQL keyword TOP) and another query for the other pages and link each one of them to a subreport. But it still does not solve my problem which is that I want to be able to see all the pages of one invoice in the print preview window.
Does someone have an idea on how to do that?
Thank you very much for your help.
 
julietita said:
Then, in the code, I fill in the pages and hide objects I do not need depending on the page I am on.
Why don't you just use a subreport or similar in the report header and bind your report to you a query? It sounds like you are using code to put data on pages rather than using bound text boxes. Why?

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top