Email help

S

SoggyCashew

Hello, I have a table named tblEmail and in this table there are email
addresses. I wanted to be able to send a report using the email addresses
from theis table insted of using it in VBA incase the list changes. I am
using the code below and it works good but I would like to get the names from
the table? How can I do this...

Private Sub cmdSendTo_Click()
On Error GoTo Err_cmdSendTo_Click

DoCmd.SendObject acReport, "Accident Illness Report", acFormatRTF,
"(e-mail address removed); (e-mail address removed); (e-mail address removed)", , , "New Accident
Illness Report", "Please review the attached report. Thanks!", False

Exit_cmdSendTo_Click:
Exit Sub

Err_cmdSendTo_Click:
MsgBox Err.Description
Resume Exit_cmdSendTo_Click
End Sub
 
W

Wayne-I-M

Hi

Why not create a combo on your form - have 3 columns
ID
Name
Emaill address

Select the name from the combo and then use this (combo name) in the e mail
code
DoCmd.SendObject acReport, "Accident Illness Report", acFormatRTF,
"COMBO NAME; (e-mail address removed); (e-mail address removed)", , , "New Accident
Illness Report", "Please review the attached report. Thanks!", False

You can do the same for the CC and BCC you have in the code you posted
DoCmd.SendObject acReport, "Accident Illness Report", acFormatRTF,
"COMBO NAME; CC COMBO; BCC COMBO", , , "New Accident
Illness Report", "Please review the attached report. Thanks!", False
 
S

SoggyCashew

Could you explain how this would be done further? OR if you know of an
example that would be even better... Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top