473,396 Members | 2,002 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

One report producing multiple unique PDF files

My situtation:
I'm not very good at Access. I've created a report (R_SalesHist) listing 1000 customers sales history. Each customer's sales history fits nicely on a single page. When I run R_SalesHist I need it to produce a PDF file for each customer number at the page break. The PDF file names need to be uniquely named as "CustomerNumber".PDF. So I'll have 1000 PDF files when the process runs. I do have a small budget and could buy a package if there is one that keeps me from having to write code.

My questions:
I have downloaded CUTEPDF to have the print to PDF ability. I know you can run a query to pick each customer number then run the report for that customer number - but not how. Can some one show me an example macro/code to do this please?

CUTEPDF uses the report name R_SalesHist as the file name for the PDF it creates. If I run the report multiple times how do I get the PDF files uniquely named as "CustomerNumber".PDF?
Jul 30 '07 #1
4 5941
BradHodge
166 Expert 100+
I'm assuming you have a command button on a form that opens your report?

If this is the case, you could try adding this code to the command button...

Expand|Select|Wrap|Line Numbers
  1. Dim strDate as string
  2. Dim strCustomer as string
  3. strDate= Format(Date, "mm-dd-yyyy")
  4. strCustomer= Forms![YOUR FORM NAME]![CUSTOMER FIELD NAME] _
  5. ' This should put the customer's number into a string
  6.  
  7.  
  8. If MsgBox("Do you want to save this report to your PC?", vbYesNo) = vbYes _
  9. 'Check to see if saving copy of report is desired.
  10.  
  11. DoCmd.OutputTo acOutputReport, "R_SalesHist", acFormatPDF, "C:\SalesHistory\strCustomer_" & strDate & ".PDF" _ 
  12. 'If so, export to PC.
  13.  
  14. MsgBox ("Your report has been saved in C:\SalesHistory.")     'Alerts User to where report is saved.
  15.  
  16. End If
NOW... All that said, I have not done this using PDF format. If CUTEPDF will allow you to do this, then the above should work. However, if it won't, you could use the same code above except replace "PDF" with "RTF" or "SNP"

Hope this helps,
Brad.
Jul 30 '07 #2
I'm the only one running the report. So, I was just going to run the report. I didn't know I needed a button on a form. I'll try creating the form and button if that is the easy way. CUTEPDF prompts for a folder and file name is that an issue? Is there a PDF creator you would recommend.

Thanks for the help and the quick response
Jul 30 '07 #3
puppydogbuddy
1,923 Expert 1GB
I'm the only one running the report. So, I was just going to run the report. I didn't know I needed a button on a form. I'll try creating the form and button if that is the easy way. CUTEPDF prompts for a folder and file name is that an issue? Is there a PDF creator you would recommend.

Thanks for the help and the quick response
See this link for Tony Toews' (Microsoft MVP) recommendations for implementing PDF.

http://www.granite.ab.ca/access/pdffiles.htm
Jul 31 '07 #4
Thanks for the PDF reference. I bought PDF995. I changed the example they have to allow me to control the outfile name and reduced the sleep delay to make it run quicker.

It's creating about 16 PDFs a minute but I might have the delay set to high still so it may prove faster.
Aug 1 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Jen | last post by:
Trying to take one table in access and split it into multiple excel files(using an excel template); and then email based on email addresses in Table2; Of course, I would like to do all of this...
1
by: dan.roffman | last post by:
Is there a way to span a report over multiple pages. I think you could do something like count the number of lines and if it exceeds a certain number, then put the rest of th text into another RTF...
0
by: ghadley_00 | last post by:
MS Access Create form / report with multiple pages using different background images Hi, Would like to have users fill out a multipage form, and then click a print button, which pulls up the...
2
by: SenthilVel | last post by:
HI all in my visual studio DOtnet . i am not able to open multiple cs files in the projects , its openings only one cs file at a time, can any one let me know, what setttings i must do in order...
3
by: Arun | last post by:
Hi, I have simple question to ask. How to write multiple Binary files to the Browser using Asp.Net and Visual C#.net I have seen examples where single binary file is written to browser. ...
3
by: greatsky | last post by:
Hello- I need to create multiple PDF files from one access report that breaks on client for approx. 20 clients. Any suggestions? Thanks!
1
by: PK9 | last post by:
I'm building a windows app using C#. The goal is to merge portions of multiple xml files into one. I currently have an .xsl stylesheet that pulls in the required sections of multiple xml files...
1
by: CF FAN | last post by:
Can Report Builder Export Excel Files with multiple Sheets How can I create a report that it can export in excel by multiple
0
by: Sells, Fred | last post by:
the short answer is a file is a module; therefore to 'include' access to 'myclass' in file xyz.py from another file called 'abc.py' you would put this in abc.py import xyz #note no '.py' x =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.