473,486 Members | 2,353 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Converting a Report to PDF (2007)

24 New Member
Hello again!

I have a report that contains information from four different queries. Each of those four queries prompts the user to enter a date range to find the records needed. When I open the report, it prompt the user for these date ranges, then populates the report accordingly. All is fine.

Now, when I go to save that report as a pdf document, it requests those same date ranges again. Is this normal or is there a way to skip the report view, and once the user clicks a button, it automatically runs the report, then saves it as a pdf document? I tried to set the macro assigned to the button to "Print Preview" instead of "Report", but you still have to enter the date ranges twice. I looked for some code examples of automatically creating a pdf, but couldn't find any.

Thanks!
Jun 14 '11 #1
3 2284
jimatqsi
1,271 Recognized Expert Top Contributor
When I have that situation I launch the report from a form. The form asks for the needed parameters, stores them in a local parameter table and then I join the parameter row into the query. Or you could simply reference the
Expand|Select|Wrap|Line Numbers
  1. Forms!frmname!txtParametername
in your query and forget about saving the parameters in a table.

For auto pdf creation, see this page. Not sure if this still works if you are using Access 2010.

Jim
http://www.lebans.com/reporttopdf.htm
Jun 15 '11 #2
noclueforid
24 New Member
Thanks, Jim.

I tried that and it worked OK, but in the process came up with another solution to just output it directly to pdf using the following code:

Expand|Select|Wrap|Line Numbers
  1.  DoCmd.OutputTo acOutputReport, "rptInvoicingIOC", acFormatPDF 
Thanks for your suggestion!
Jun 15 '11 #3
NeoPa
32,556 Recognized Expert Moderator MVP
I've updated the title to reflect that you are using Access 2007 or later. This is always important, but especially so when asking about facilities introduced in a particular version.

Stephen Lebans' code is only required for versions 2003 and earlier. Otherwise the facility is included as standard in Access.
Jun 15 '11 #4

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

Similar topics

4
2470
by: mustafa | last post by:
Dear sir , I have built my application in visual basic 6.0 and crystal Report8.5 , Now i migrated my application to VB.net using the upgrade wizard.My visual basic form is upgraded to vb.net...
2
2838
by: mike | last post by:
regards: I follow the following steps to converting from HTML to XHTML http://webpageworkshop.co.uk/main/xhtml_converting My parser is http://htmlparser.sourceforge.net/ Xhtml version is 1.0...
2
1478
by: Richard | last post by:
Hi, I need to create an HTML-dokument from a report in Access. I need to do this in code. What I need to do is to keep the original format settings with borders around text boxes and pictures on...
1
17625
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
2
1393
by: Yisroel Markov | last post by:
Greetings, The subject says it all. Certain operations that used to run pretty fast in A97 take noticeably longer after converting a database app to A2K. For example, during login process the...
2
2115
by: Mark Flippin | last post by:
I'm converting the backend of an Access 2000 database to SQL Server 2000. The existing database has user and group security through a specific workgroup file. Under the "user and group...
1
2843
by: lorirobn | last post by:
Hello, I created an Access database in Access 2002-2003 that I am trying to convert to Access 2000. During conversion, I get error "The report name ' dirDataCopy' you entered in either the...
2
1723
by: Rod | last post by:
We've got an old VB6 application we wrote years ago, that we're working on converting parts of, to an ASP.NET application. So far, the work is going well. Now I'm looking at trying to convert...
0
1504
by: jacobjoseph | last post by:
I am using report builder to generate reports. The same report, i would like to convert into excel and pdf format. Can u plz advise, how it can be done? Support from experts will be of gr8 help to...
6
2112
by: gonella123 | last post by:
I am getting #Error while generating report, after converting the database from 2003 to 2007. The "#Error" when run the report. On this you have report elements use nested if-statements as...
0
7105
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
6967
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...
0
7132
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
7180
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7341
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...
1
4870
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...
0
1381
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 ...
1
600
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
266
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...

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.