Solved

MS Access 2010 SendObject using .pdf Format for Report

Posted on 2012-03-15
7
922 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Resolve DNS query failed errors for Exchange
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

760 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

23 Experts available now in Live!

Get 1:1 Help Now