473,586 Members | 2,855 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

One report producing multiple unique PDF files

3 New Member
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 5965
BradHodge
166 Recognized Expert New Member
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
mehrhardt
3 New Member
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 Recognized Expert Top Contributor
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
mehrhardt
3 New Member
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
6666
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 with minimum user-interface...If there is anyone out there that can help... please feel free to share!:) PS... Using MSOffice 2000 Example:...
1
1869
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 control. I just don't know how to code that... Any help appreciated. D
0
5368
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 info just entered for a particular record and print out multiple pages of forms, each page having a different image as background.
2
2172
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 to get all the CS files to edit so that i can see all the files opened. Thanks Senthil
3
3458
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. -Regards Arun
3
2713
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
9985
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 and combines them into one xml file. This xsl works correctly. I'm now trying to utilize this xsl in my C# application, along with the required...
1
6186
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
1116
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 = xyz.myclass() or from xyz import myclass #if you're lazy use ... import * x = myclass()
0
7839
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8215
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6610
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5710
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3836
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3864
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2345
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1448
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1179
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.