Help Please - Save each page of report to seperate file

mjacobsen

New Member
Joined
Apr 26, 2006
Messages
11
Hi – I have used access to create a set of monthly invoices in a report. Each invoice is only one page but the report is for all customers (so contains 182 pages). This is ok for producing the invoices and printing, however I need to create an electronic copy of each invoice (one page) to send to each customer. How can this best be achieved? My current thought is to create a new able that only contains the customer name. Process would then be update this new table with one customer name – output the report to file – delete the customer from new table – repeat for the next customer.

I have:

Original table (“Invoice_Data”, with a populated field named “Customer”)
New Table (“Output”, with an empty field named “Customer”)
Report (“Invoice” with “Customer” in the page header linked to “Output” table)

So what I want to do is the following:

For each record in “Invoice_Data”
Copy [Customer] to “Output!Customer”
OutputTo acReport, "Invoice", "MS-DOSText(*.txt)", "c:\[Customer] Invoice.txt", True, "", 0

Clear “Output!Customer”

Next record

Is this possible? Is it the best solution?

Thanks for your help
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Rather than writting customer numbers to a new table, just create a query that is just the customer numbers. Then, within VBA code, make a recordset out of this query. For each record in the query, do your OutputTo acReport. The query for the report could look to a hidden form that will have the current customer number to process. Of course you will need to write this customer number to the hidden form after you read the customer number from the recordset, and just before you do the OutputTo acReport.
 
Upvote 0
Vic- thanks for the suggestion. Can anyone give me an idea of how to do this (recordset code) or does anyone have some similar code that I can copy as I have not had any luck so far.

Cheers
Mark
 
Upvote 0

Forum statistics

Threads
1,214,586
Messages
6,120,402
Members
448,958
Latest member
Hat4Life

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top