Solved

MS Access 2010 SendObject using .pdf Format for Report

Posted on 2012-03-15
7
924 Views
Last Modified: 2012-03-28
I am using MS Access 2010.  I converted a database from 2003 to 2010.  There is a print preview report that appears and a button added to the Add-Ins tab of the ribbon for the SendObject macro to email the report but it doesn't work.  It was set to mail a snapshot so I changed it to .pdf instead.  When I click the button the window appears stating one page of the report has been created but it hangs up here.  It never opens Outlook 2010 to attach the report.

Thinking that everything I needed may not have been installed I tried to save and publish this same report as a .pdf and that worked fine so I'm thinking I have everything I need to do this.  I found a lot of information, some for add-ins in 2007 that are needed and other information stating that .pdf is built in and nothing is needed.  Can someone please shed some light on why this won't work?

Also, I know you can do this with VBA but I am not a programmer so I prefer to go the route of the macro first.  Thanks in advance for your help.
0
Comment
Question by:avlna
  • 3
  • 3
7 Comments
 
LVL 39

Expert Comment

by:als315
ID: 37726127
In Access 2010 you have Send button on Export Ribbon. Have you tested it?
Code for your button should be like this:
DoCmd.SendObject acSendReport, Screen.ActiveReport.Name, acFormatPDF
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 37726623
<No Points wanted>

It is not clear if this custom button even worked...?
...or how it was created/coded,...?
.......or how you modified it ...?
.....or how, or if the email address get populated...
...etc

To be safe, I try to put any custom functionality on a form.
So I would use code like als315 posted, but on a button on a form.

Get something simple like this working *First*, ...then worry about putting it on a Ribbon later.

;-)

JeffCoachman
0
 

Author Comment

by:avlna
ID: 37728922
This was created in Access 2003 and it worked until it was converted to 2010.  The problem is that I can no longer use the snapshot because it doesn't exist in 2010 so I needed to change it to a .pdf and now it hangs up.

als315 - As I stated I'm not a programmer so I don't even know what to do with your code.

boag2000 - Yes, it worked in 2003 but not after converting to 2010.  That is why I changed the .snp to .pdf.

It was created so when it's clicked a macro runs using SendObject.

I modified it by opening the macro in design view and changing the Output Format from .snp to .pdf.  (see attached)

The email field doesn't get populated.  It's an optional field and the person sending the report will fill in the To: field once the email opens.

This is a report, not a form and the report is generated after the data is entered.  It is not necessary to close the form and then generate a report to send it.

I didn't attach it to the ribbon that happened when it was converted.
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 37729285
Then again, I would simply ignore/disable this in the ribbon and do it from a form/report with code similar to what the first Expert posted.

Again, unless you want to get involved in customizing ribbons, I would just do this directly in code.
0
 

Accepted Solution

by:
avlna earned 0 total points
ID: 37729666
Customizing ribbons, like toolbars, is very easy and Access has an option for it.

This turned out not to be an Access issue but anOutlook issue.  Access did still need the .snp to be changed to a .pdf but once Outlook was reinstalled no other changes needed to be made and it worked fine.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 37730421
<Customizing ribbons, like toolbars, is very easy and Access has an option for it.>
Customizing ribbons is still a long way from being "Easy" for most new Access developers...
...As is evidenced by the hundreds of question here on how to do this...

I'm glad you got your issue sorted..

;-)

Jeff
0
 

Author Closing Comment

by:avlna
ID: 37775693
I accepted my own because that resolved the problem and also because when I tried to delete the questions the instructions from Expert Exchange said to do that.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Follow this checklist to learn more about the 15 things you should never include in an email signature from personal quotes, animated gifs and out-of-date marketing content.
Large Outlook files lead to various unwanted errors and corruption issues. Furthermore, large outlook files can also make Outlook take longer to start-up, search, navigate, and shut-down. So, In this article, i will discuss a method to make your Out…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now