Dim Directors As ADODB.Recordset
Set Directors = New ADODB.Recordset
Directors.Open "tblofyournamesandemailaddresses", CurrentProject.Connection,
adOpenStatic
Do Until Directors.EOF
[Forms]![frm_EMail].[txtDirector].Value = Directors![Name]
[Forms]![frm_EMail].[txtEmail].Value = Directors![E_Mail]
On Error Resume Next
DoCmd.SendObject acSendReport, "nameofyourreport", acFormatSNP,
[Forms]![frm_EMail].[txtEmail], , , "subjectofemail", , True
On Error Resume Next
Directors.MoveNext
Loop
This code placed in the onclick event will generate a report for each
individual and attach it to an email to the individual.
You need a table with the names and email addresses of all the people your
are including.
Directors is just a name but it refers to the table you have with all your
names.
the report must have a record source of a query with the criteria pointing
to textboxes on the form you are using to generate the reports and emails.
--
Jeff C
Live Well .. Be Happy In All You Do
Gntlhnds said:
I have found out that you can't put functioning buttons in a report, but how
about finding a way to generate an email that is automatically addressed to
the list that query comes up with? That would work just as well (preferably
by clicking a button somewhere, wether via the switchboard or whatever).