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 / General 2 / January 2008

Tip: Looking for answers? Try searching our database.

Automating Emailed Reports from Access

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rhmorrison@hotmail.com - 14 Jan 2008 05:56 GMT
Hi,

I have a database to track appointments for consultants. What I need
to do is run a report for each consultant and email their individual
reports to them. I'd like to be able to do this from one command
button on the main form. Any ideas how I would do this?

Thanks
r.
Dale Fye - 14 Jan 2008 13:41 GMT
The way I have done this in the past is to:

1.  Add an unbound textbox to your form (you can hide it).
2.  Create your report, and have the query that supports it based on that
unbound text box (consultant).
3.  Then, in the code behind the Click event of your command button, create
a recordset of consultants (SELECT ConsultantID, C.email from Consultants C
INNER JOIN ConsultantSchedule CS ON C.ConsultantID = CS.ConsultantID WHERE
CS.ApptDate = #1/15/2008#)

4.  Loop through the consultants, populate the unbound textbox with the
ConsultantID retrieve in this recordset
5.  Inside the loop, use SENDOBJECT to send the report to the consultant.  
Depending on which security updates you have, and what your email software
is, you will probably get a security warning for each of the SendObject
messages.  Although I've recently seen a message on my machine that allows me
to set a timeframe where I can use multiple SendObject commands and only get
the security warning once.

HTH
Dale
Signature

Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.

> Hi,
>
[quoted text clipped - 5 lines]
> Thanks
> r.
Tom van Stiphout - 14 Jan 2008 14:04 GMT
DoCmd.SendObject is the simplest way to send a report with
appointments. Your report would use a query that "looks back" on a
form to see for which ConsultantID the report would be generated.
Once you have that, just execute that in a loop over all consultants.
In the loop you would also set that "look back field" to the current
ConsultantID.

-Tom.

>Hi,
>
[quoted text clipped - 5 lines]
>Thanks
>r.
 
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



©2009 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.