469,950 Members | 2,361 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,950 developers. It's quick & easy.

DoCmd.SendObject to table of email addresses?

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
4 8426
isetea
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
I'll give it a try. Thanks!
Sep 28 '06 #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
1,418 Expert 1GB
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.

Similar topics

1 post views Thread by bgreer5050 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.