[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 328
  • Last Modified:

Access VBA - automatically converting a report to PDF and emailing

Hi

What Access VBA code would I use to automatically generate a report?

Thanks
0
Murray Brown
Asked:
Murray Brown
  • 4
  • 3
  • 2
  • +1
3 Solutions
 
Dale FyeCommented:
not sure what you mean by "automatically generate a report"?

You can design a report by creating a query, then using the report wizard to create the report, but I've never heard of "automatically generate a report".

Or do you just want to run a report from a command button?  If this is what you had in mind, you can either use the control wizard when adding a command button, or write the code yourself.  If this is what you had in mind, post back.
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
I found the following code. I want to convert an open report called "Invoice" to a PDF file then email it
from any email system

DoCmd.OutputTo acOutputReport, "Invoice", acFormatPDF, myFileName
0
 
Dale FyeCommented:
I'm not sure whether the SendObject method works with "any email system", but that I would look at the examples associated with that method in Access help.  If that doesn't work for you, then search in EE solutions on SendObject.  You will find lots and lots of posts on that subject.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
JAndreassenCommented:
I use this command to send a report as PDF from my Outlook and it works perfectly. Just have to allow Access to use Outlook, a popup box.
0
 
Jeffrey CoachmanCommented:
Then do this:

DoCmd.SendObject acSendReport, "YourReportName", acFormatPDF, "SomeEmailAddress", , , "SomeSubject", "SomeMessage", False


This presumes Access 2007 with the PDF add in installed.
0
 
Jeffrey CoachmanCommented:
Also remember, that in Access 2007, ...when the report is open you can click:
Office Button-->Email-->PDF Format

JeffCoachman
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Thanks very much. If I am going to install my application on other people's machines then is using PDF the best option?
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
thanks very much
0
 
Jeffrey CoachmanCommented:
<I found the following code. I want to convert an open report called "Invoice" to a PDF file then email it
from any email system>

...Sorry, I just read this...

If you want to email with "Any email system" you will have to use any of the available "Emailing" programs:
CDO:
http://www.google.com/#hl=en&q=VBA+Microsoft+Access+cdo+email&aq=f&aqi=&aql=&oq=&gs_rfai=&fp=8631cdd35a4d476d

FMSINC:
http://www.fmsinc.com/MicrosoftAccess/Emails.asp

There are others as well, do a search here or on google.

;-)

JeffCoachman
0
 
Jeffrey CoachmanCommented:
<Thanks very much. If I am going to install my application on other people's machines then is using PDF the best option?>
Probably, as most people have Acrobat loaded on their machines already.
Also, under normal circumstances, a PDF cannot be edited.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now