Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Reports / Printing / January 2006

Tip: Looking for answers? Try searching our database.

E-mailing a report

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kate Cz - 19 Dec 2005 21:15 GMT
Hello,  I've seen several postings, but am a beginner and don't understand
quite yet:

How can I e-mail a report from a form of only the current record? When I try
to e-mail it now, the report contains all of my records. If anyone can help
the more direction the better ie if this requires code, where, what, how, etc.
If I can do it in a macro, that would be preferable as I do understand those.

Thank you,
Bob Miller - 20 Dec 2005 17:54 GMT
You can place the conditions in a query and base the report on the
query.  Let's say you want to be looking at a certain record with a
RecNo = 1.
In Criteria for RecNo in the query, place this:
=Forms![name_of_form].[RecNo]
On your form, put a button that runs a macro that sends the report.
The form can't be closed before the report is sent.
Hope this helps.
Kate Cz Wrote:
> Hello,  I've seen several postings, but am a beginner and don't
> understand
[quoted text clipped - 10 lines]
>
> Thank you,

Signature

Bob Miller

David Lloyd - 21 Dec 2005 02:58 GMT
Kate:

In the Click event of a form button, you might want to try code similar to
the following:

       DoCmd.OpenReport "MyReport", acViewPreview, , "ID=" &
CInt(txtIDField), acHidden
       DoCmd.SendObject acSendReport, "", acFormatSNP, "email@address.com",
, , "Email Subject", "Email Message", False
       DoCmd.Close acReport, "MyReport", acSaveNo

The idea here is to use the Where parameter of the OpenReport method ("ID="
& CInt(txtIDField) ) to limit the report to a single record.  This example
assumes you have an ID field on your form in a textbox called txtIDField.
You will have to adjust this to use a field on your form that distinguishes
each record.  Once we have opened the filtered report, we can call the
SendObject method to email the open report to the recipient.  Finally, the
open report is closed.

I have used the acFormatSNP constant to email a snapshot in this example.
You can choose another format to suit your needs.

Signature

David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.

Hello,  I've seen several postings, but am a beginner and don't understand
quite yet:

How can I e-mail a report from a form of only the current record? When I try
to e-mail it now, the report contains all of my records. If anyone can help
the more direction the better ie if this requires code, where, what, how,
etc.
If I can do it in a macro, that would be preferable as I do understand
those.

Thank you,
Kate Cz - 29 Dec 2005 15:53 GMT
Much Appreciated David -  This helped thank you.
>Kate:
>
[quoted text clipped - 29 lines]
>
>Thank you,
Vivi - 31 Jan 2006 22:58 GMT
Dear David:  

Your method is quite helpful.  But I have one more question, since my form
has another subform (ID, and e-mail address) to keep all e-mail addresses.

How can I mail the report to those who has the same ID??? Since the way you
provide is the dedicated e-mail address.

Thanks.

Vivi

> Kate:
>
[quoted text clipped - 29 lines]
>
> Thank you,
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.