Can you email an Access Report?

JohnPapa

Registered User.
Local time
Today, 07:30
Joined
Aug 15, 2010
Messages
1,141
Does anyone know if there is a way to email the output of an Access report? For eaxample, let's say I produce a report of the customers in my db. Can this report be emailed?
Thanks
 
Yes, look into the

DoCmd.SendTo

command in VBA (or in a macro the action is SendTo)
 
Many thanks, I used

Docmd.SendObject ....

to send the report, in SNP format. Do you know whether the SNP format is generally readable.
John
 
From Wikipedia via Google:

The SNP file format is used by Microsoft Access to store Report Snapshots in a single file which can be viewed and printed by the Microsoft Snapshot Viewer, available as a no-additional-charge download from Microsoft (runs on Windows only). This allows report output to be exported and viewed on Windows computers which do not have Microsoft Access installed.
 
Apart from the SNP format, are you aware of any other format that can display pictures, in addition to text.
John
 
You can always provide a link to the readily available, and freely, downloadable Snap Shot viewer, as part of your message.
 
Last edited:
Do you know whether there is a way to name the .snp attachment, other than the automatic name of the report that I am sending using SendObject?
 
I have to send out access reports all the time to people who don't use it, however they only usually contain data, which I normally just export as a RTF and then just resave as a word document just for those who are not that savvy on computers.

Does that help?
 
Do you know whether there is a way to name the .snp attachment, other than the automatic name of the report that I am sending using SendObject?

I found this thread which should do what you are after, I've not tested it so can't vouch for it's efficacy.
 
Last edited:
I have to send out access reports all the time to people who don't use it, however they only usually contain data, which I normally just export as a RTF and then just resave as a word document just for those who are not that savvy on computers.

Does that help?

I've had a look at that in the past and found that you loose a lot of the formatting and unless as you say your report is quite simple it just doesn't work that well hence my suggestion.

Additionally, I've compressed the URL using Tinyurl.com as I had an occasions were the URL got a line feed inserted in it by the recipients email client :rolleyes: and he couldn't reconstitute the url, not that savvy with computers it turned out :( but once he got the tiny url no problem :)
 
The code below works fine when run from the mdb, but nothing happens when I run the mde, which is produced from the mdb. I have checked with msgbox commands and all commands get executed. Do you have any ideas?

stDocName = "VD-" & CStr(Format(Now, "yymmdd")) & "-" & Forms!frmDentalInfo!lngCustomerID & "-" & Forms!frmRootCanalTreatmentTemp!lngTooth
DoCmd.CopyObject , stDocName, acReport, "rptRootCanalTreatmentTemp"
DoCmd.SendObject _
acSendReport, _
stDocName, _
acFormatSNP, , , , , "*** If you cannot view the .snp attachment download Snapshot viewer from Microsoft.com ***"
DoCmd.DeleteObject acReport, stDocName

The mdb opens outlook and attaches the report as file VD-date-Customer-tooth.snp. BTW this is a dental software package (www.VisualDentist.com)
 
You can't use CopyObject in an mde as no design changes can be made in forms, reports, macros, or modules. So why are you using that? Not quite sure what is up with that.
 
Thanks. The goal is to be able to email a report in .snp format (X-rays on report). If I cannot do this using an mde, do you have any idea as to how I can email the report?
 
You can email a report just fine. You just can't use the copy which you have been doing. I am thinking you have a form and are saving it to a report and then using that. You need to build a report which is a report and base the record on the form displayed, not copy it to a report.
 
Thanks again. The reason why I use the copy is to be able to rename the report to something custom (as opposed to the original name of the report or what appears on the report caption). I did not seem to be able to set the caption property in the OnOpen event of the report.
 
Thanks again. The reason why I use the copy is to be able to rename the report to something custom (as opposed to the original name of the report or what appears on the report caption). I did not seem to be able to set the caption property in the OnOpen event of the report.
You set the Caption in the FORMAT event of the section it is in. So if in the Report Header you set it in the On Format event of the Header section.
 
Thanks Bob for your replies. Let me try to summarize: I have a form (frmRootCanalTreatmentTemp) which is based on a table (tblRootCanalTreatmentTemp), which holds some root canal measurements. The form is also used to define other data such as, the pathname for 2 X-rays as well as general comments etc. The report (rptRootCanalTreatmentTemp) is based on the the table (tblRootCanalTreatmentTemp) and also mines the information defined on the form. The report is called from the form using SendObject and I wan to be able to define the name of the .snp attachment. If I can do this by defining the Caption property, where do I define it? You mention in the Format event, but I a not clear which Format event. Thanks.
 
johnpapa

which version of access are you using. from A2007 on, you can produce pdf's instead of snapshot's

because so few people have the snapshot viewer, i send pdf's anyway.

steven lebans has easy to use code that generates a pdf in versions of access earlier than A2007. Basically the code generates a snp file, and then turns it into a pdf.
 

Users who are viewing this thread

Back
Top Bottom