[AccessD] E-mail Report

Roz Clarke roz.clarke at donnslaw.co.uk
Wed May 18 08:57:51 CDT 2005


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