Solved

MS Access 2010 SendObject using .pdf Format for Report

Posted on 2012-03-15
7
934 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 40

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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
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

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!

Question has a verified solution.

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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Outlook for dependable use in a very small business   This article is about using the Outlook application (part of Microsoft Office) in a very small business, or for homeowners where dependability and reliability are critical requirements. This …
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

687 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