[AccessD] E-mail Report

Roz Clarke roz.clarke at donnslaw.co.uk
Wed May 18 10:02:15 CDT 2005


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
-------------- next part --------------

The contents of this message and any attachments are the property of Donns Solicitors 
and are intended for the confidential use of the named recipient only.  They may be legally
 privileged and should not be communicated to, or relied upon, by any other party without 
our written consent.  If you are not the addressee, please notify us immediately so that we 
can make arrangements for its return.  You should not show this e-mail to any person or
 take copies as you may be committing a criminal or civil offence for which you may be
 liable.  The statement and opinions expressed in this e-mail message are those of the 
writer, and do not necessarily represent that of Donns Solicitors.  Although any files attached
 to this e-mail will have been checked with virus protection software prior to transmission, 
you should carry out your own virus check before opening any attachment.  
Donns Solicitors does not accept any liability for any damage or loss which may be caused 
by software viruses...


More information about the AccessD mailing list