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?
4 5965
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... - Dim strDate as string
-
Dim strCustomer as string
-
strDate= Format(Date, "mm-dd-yyyy")
-
strCustomer= Forms![YOUR FORM NAME]![CUSTOMER FIELD NAME] _
-
' This should put the customer's number into a string
-
-
-
If MsgBox("Do you want to save this report to your PC?", vbYesNo) = vbYes _
-
'Check to see if saving copy of report is desired.
-
-
DoCmd.OutputTo acOutputReport, "R_SalesHist", acFormatPDF, "C:\SalesHistory\strCustomer_" & strDate & ".PDF" _
-
'If so, export to PC.
-
-
MsgBox ("Your report has been saved in C:\SalesHistory.") 'Alerts User to where report is saved.
-
-
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.
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
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
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.
Sign in to post your reply or Sign up for a free account.
Similar topics |
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:...
|
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
|
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.
|
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
|
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
| |
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!
|
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...
|
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
|
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()
|
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...
|
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...
| |
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |