doctorswamp
Technical User
Hi all
There are some useful FAQs on this, but have a small problem. Sorry it may be old ground.
Want to email people selected in a fixed query using a command button. This code nearly does it
----------------
Dim rs As DAO.Recordset
Dim qd As DAO.QueryDef
Set qd = CurrentDb.QueryDefs("qryEmail")
Set rs = qd.OpenRecordset
Do Until rs.EOF
DoCmd.SendObject , , , rs!Email, , , "Subject words", "Body words"
rs.MoveNext
Loop
----------------
The problem is the messages aren't immediately sent to the Outbox, so I have to click Send for each one. How do I send them straight to the outbox?
I'd also prefer to do a filter by form and use the output as the email source rather than the fixed query. How could this be done?
Finally, instead of putting the subject and body text into the code, can I say put them into fields on the form - or somewhere else?
Many thanks
There are some useful FAQs on this, but have a small problem. Sorry it may be old ground.
Want to email people selected in a fixed query using a command button. This code nearly does it
----------------
Dim rs As DAO.Recordset
Dim qd As DAO.QueryDef
Set qd = CurrentDb.QueryDefs("qryEmail")
Set rs = qd.OpenRecordset
Do Until rs.EOF
DoCmd.SendObject , , , rs!Email, , , "Subject words", "Body words"
rs.MoveNext
Loop
----------------
The problem is the messages aren't immediately sent to the Outbox, so I have to click Send for each one. How do I send them straight to the outbox?
I'd also prefer to do a filter by form and use the output as the email source rather than the fixed query. How could this be done?
Finally, instead of putting the subject and body text into the code, can I say put them into fields on the form - or somewhere else?
Many thanks