Sending Emails to Individuals

G

Guest

All,

I have a continuous form that list our sales persons, and a link to send Off
Day Deliveries

I am using the SendObject. What I would like to do is, in the morning have
it send out the reports automatically without me having to use "Alt + S"

Attached is the Code that I am using.
Any and all Help is appreciated
------------------------------------------------------------------------------------------
Private Sub Command10_Click()
On Error GoTo Err_Command10_Click

Dim stDocName As String
Dim stToName As String
Dim stCCName As String
Dim stDate As String
Dim stsubjline As String
Dim stbody As String
Dim stDSM As String

stDocName = "rptDistrictOffDayDelivery"
stToName = Me.DSMID
stCCName = Me.RSMID
stDate = Me.SESSION_DATE
stDSM = Me.CMMGR_
stsubjline = "Off Day Delivery Report for DSM " + stDSM + " on " + stDate
stbody = "Enclosed is the Off Day Delivery Report for your District"


DoCmd.SendObject acReport, stDocName, "Snapshot Format", stToName,
stCCName, , stsubjline, stbody

Exit_Command10_Click:
Exit Sub

Err_Command10_Click:
MsgBox Err.Description
Resume Exit_Command10_Click

End Sub
 
G

Guest

Hi,
set up a query which filters your data as you need it.
Then create a macro which calls your routine which uses the query data to
send everything out.
Then use a scheduler to call this macro...you might find this article helpful:
http://support.microsoft.com/kb/230575/EN-US/
Make sure the last action of the macro is to shut down the application.
HTH
Good luck
 
G

Guest

I made a change to the Code that does not bring up the actual e-mail. But
now I am getting a message (From the Security patch) where it requires you
to answer "Yes" you know that an outside aplication is trying to send out an
e-mail.


Is there a way around this? I would really like to have this done. its
gets ugly when I only get 2 hours of sleep.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top