By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,175 Members | 1,689 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,175 IT Pros & Developers. It's quick & easy.

DoCmd.SendObject to table of email addresses?

P: 3
I'd like to send a report to a distribution of email addresses. The distribution list is stored in Email.[email]. How do I use the DoCmd.SendObject to send to a list? The command below isn't working:
DoCmd.SendObject acReport, "Upcoming Week OT Report", "RichTextFormat(*.rtf)", Email.[email], "", "", "Upcoming Week OT Report", "", False, ""
Sep 27 '06 #1
Share this Question
Share on Google+
4 Replies


P: 44
Hello,
I'm not an expert with Access, but I had a very similar problem last time and maybe you can try this code.

Dim stDocName As String

stDocName = "Reportname"
DoCmd.SendObject acReport, stDocName, acFormatRTF, "TO", "CC", "BCC", "Upcoming Week OT Report"

If you are familiar with VBA, you can have a look what you need there or use Access help and look for 'SendObject Method'.

Hope this helps

Cheers

I'd like to send a report to a distribution of email addresses. The distribution list is stored in Email.[email]. How do I use the DoCmd.SendObject to send to a list? The command below isn't working:
DoCmd.SendObject acReport, "Upcoming Week OT Report", "RichTextFormat(*.rtf)", Email.[email], "", "", "Upcoming Week OT Report", "", False, ""
Sep 27 '06 #2

P: 3
I'll give it a try. Thanks!
Sep 28 '06 #3

P: 3
Another programmer gave me the following and it's working:
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
Dim strSQL As String
strSQL = "Select * from EmailTable"
rs.Open strSQL, CurrentProject.Connection, adOpenKeyset, adLockReadOnly
rs.MoveFirst
Do While Not rs.EOF
DoCmd.SendObject acSendReport, "Upcoming Week OT Report", acFormatRTF, rs!EmailAddress, , , "New Way", "Upcoming Week OT Report", False
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
Sep 28 '06 #4

PEB
Expert 100+
P: 1,418
PEB
But maybe you are working with Visual Basic 6.0 and not with Access???

Or with Access but on an Access project connected to SQL Server?

Those are important details however!

:)
Sep 30 '06 #5

Post your reply

Sign in to post your reply or Sign up for a free account.