send an email using recipients from a query (1 Viewer)

109bow

Registered User.
Local time
Today, 13:26
Joined
Oct 24, 2007
Messages
134
I have a query which I need to email in an excel format to a changing list of recipients. The recipients are held in a query "email_lastturndata_qry" using the field "email_address" for the recipient email addresses.
I have this code so far,

Private Sub emailpostturndiameters_Click()

DoCmd.OpenQuery "email_lastturndata_qry", , acReadOnly
DoCmd.SendObject acSendQuery, "post_turn_wheeldiameters", acFormatXLS, "", , , "Post turn wheel diameters", "Attached are the post turn wheel diameters for 110**+110** (amend as required)", True
DoCmd.close acQuery, "email_lastturndata_qry"

End Sub

Is it possible to add the email_address field as the To part of the email?
I'm still trying to get my head round VBA so any help much appreciated.

Many thanks
 

theDBguy

I’m here to help
Staff member
Local time
Today, 05:26
Joined
Oct 29, 2018
Messages
21,473
You might be able to use this simple function to put all the email addresses together for the To argument.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 13:26
Joined
Jul 9, 2003
Messages
16,282
You might find Gina Whipps website useful. She has a nice piece of code for sending email to multiple recipients:-

 

Users who are viewing this thread

Top Bottom