public Sub MailReport(stTitle As String, stAddress As String, stTrueOrFalse)
DoCmd.SendObject acSendReport, stTitle, acFormatXLS, stAddress, , , _
"Report " & Date, "Please find attached your report ._
" & vbCrLf & vbCrLf & "Regards" & vbCrLf & vbCrLf & "John Doe", stTrueOrFalse
End sub
Private Sub Command1_Click()
Call MailReport("one", "me@home.com", 0)
Call MailReport("two", "me@work.com", 0)
Call MailReport("three", "you@home.com", 0)
Call MailReport("four", "you@work.com", 0)
end sub
I use the above 2 examples subs to send reports by mail
which is fine and works well BUT:
I now want to do a simular thing however I want to
mail the reports to several recipients therefore
it would be far better to have a table of email addresses
I don't know how to do this (the dreaded dlookup perhaps)?
I think the table would consist of
reportName mailAddress
one me@home.com etc
Any ideas please
Thanks
DoCmd.SendObject acSendReport, stTitle, acFormatXLS, stAddress, , , _
"Report " & Date, "Please find attached your report ._
" & vbCrLf & vbCrLf & "Regards" & vbCrLf & vbCrLf & "John Doe", stTrueOrFalse
End sub
Private Sub Command1_Click()
Call MailReport("one", "me@home.com", 0)
Call MailReport("two", "me@work.com", 0)
Call MailReport("three", "you@home.com", 0)
Call MailReport("four", "you@work.com", 0)
end sub
I use the above 2 examples subs to send reports by mail
which is fine and works well BUT:
I now want to do a simular thing however I want to
mail the reports to several recipients therefore
it would be far better to have a table of email addresses
I don't know how to do this (the dreaded dlookup perhaps)?
I think the table would consist of
reportName mailAddress
one me@home.com etc
Any ideas please
Thanks