[AccessD] E-mail Report

Gowey Mike W Mike.W.Gowey at doc.state.or.us
Wed May 18 12:56:44 CDT 2005


Roz,

You are the best, that worked like a charm, exactly what I needed.  I
don't know what I would do without this list.  Thanks again for the
great help. 


Mike Gowey  MCDST, A+, LME, NET+
Team Leader - East Region
Information Systems Unit

-----Original Message-----
From: Roz Clarke [mailto:roz.clarke at donnslaw.co.uk] 
Sent: Wednesday, May 18, 2005 9:02 AM
To: 'Access Developers discussion and problem solving'
Subject: RE: [AccessD] E-mail Report

Sorry, I sent that in a hurry.

txtBody is a control on the form that launches the code and contains
standard text to be inserted into the body of each email.

Check out the syntax for SendObject. 

SendObject(ObjectType, ObjectName, OutputFormat, To, Cc, Bcc, Subject,
MessageText, EditMessage, TemplateFile)

"Limitation Report" is my subject line, Me!txtBody is the body text, and
True means the email can be edited before sending.

-----Original Message-----
From: Gowey Mike W [mailto:Mike.W.Gowey at doc.state.or.us]
Sent: 18 May 2005 15:18
To: Access Developers discussion and problem solving
Subject: RE: [AccessD] E-mail Report


Roz,

This looks pretty good, I tried it out, but it errors out on the
following
part, saying it can't find "txtbody"

DoCmd.SendObject acSendReport, "rpt_MONTHLYLimitationDatesCLH",
acFormatRTF,
rsRecipients!CLH, , , "Limitation Report", _
        Me!txtBody, True


What are you referring to on the last part of the above line "Limitation
Report", Me!txtBody, True

Thanks so much for your help.


Mike Gowey  MCDST, A+, LME, NET+
Team Leader - East Region
Information Systems Unit
-----Original Message-----
From: Roz Clarke [mailto:roz.clarke at donnslaw.co.uk] 
Sent: Wednesday, May 18, 2005 7:58 AM
To: 'Access Developers discussion and problem solving'
Subject: RE: [AccessD] E-mail Report

I do something like this in the code below:

Dim cnn As New ADODB.Connection
Dim rsRecipients As New ADODB.Recordset

Set cnn = CurrentProject.Connection
rsRecipients.Open "qryLimitationRecipients", cnn, adOpenForwardOnly

If rsRecipients.EOF = True And rsRecipients.BOF = True Then
    MsgBox "No results returned"
Else
    rsRecipients.MoveFirst
    Do Until rsRecipients.EOF = True
        DoCmd.OpenReport "rpt_MONTHLYLimitationDatesCLH", acViewPreview,
,
"CLH = '" & rsRecipients!CLH & "'"
        DoCmd.SendObject acSendReport, "rpt_MONTHLYLimitationDatesCLH",
acFormatRTF, rsRecipients!CLH, , , "Limitation Report", _
        Me!txtBody, True
        DoCmd.Close acReport, "rpt_MONTHLYLimitationDatesCLH"
        rsRecipients.MoveNext
    Loop
End If

In this instance CLH is the field in my recordset containing the email
address. I am running a report filtered for each row in the recordset so
that people get the records relating to themselves.

HTH

Roz

-----Original Message-----
From: Gowey Mike W [mailto:Mike.W.Gowey at doc.state.or.us]
Sent: 18 May 2005 14:42
To: Access Developers discussion and problem solving
Subject: [AccessD] E-mail Report


 
Is there a way to run a query from a customer table and grab the e-mail
address of certain customers and e-mail each one of them a
report/letter.

Any help would be greatly appreciated.

Thanks in advance,

Mike Gowey  MCDST, A+, LME, NET+
Team Leader - East Region
Information Systems Unit

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list