Access 2003 - email question

A

Abay

Hello .. I am sending email from access based on a switch being set on a
detail form, (multiple entries for one master, with different email
addresses on each detail transaction). Note: there are probably better ways
to do this, but I learn as I go along, so pls excuse my amateur approach.

This is fine when the email is being sent to just one person.

I would like to be able to send emails to different addresses in one go.
Following please find the code being used to send to one person .. the
email_sw can be set for multiple entries on the form, which is fine if all
the entries are to go to one address, as is sometimes the case. I need a
way to tell access to generate the email for each transaction selected.

Any help on this would be much appreciated ... Abay

Private Sub Command169_Click()
On Error GoTo Err_Command169_Click
If Me.Dirty = True Then Me.Dirty = False

Dim stDocName As String

DoCmd.OpenQuery "Qselect_email"
'Me.Email.SetFocus

DoCmd.SendObject acSendReport, "Rtelephone", acFormatRTF, , , ,
"***Telephone Message*** From DTS" DoCmd.SetWarnings False

If Me.Dirty = True Then Me.Dirty = False

DoCmd.OpenQuery "Qemail_clear" 'clears the email sw

DoCmd.SetWarnings True
If Me.Dirty = True Then Me.Dirty = False


Exit_Command169_Click:
Exit Sub

Err_Command169_Click:
MsgBox Err.Description
Resume Exit_Command169_Click

End Sub
 
Top