By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,214 Members | 2,072 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,214 IT Pros & Developers. It's quick & easy.

Help Needed With Sending Email Addresses To Outlook

P: n/a
I'm using the following code to send email addresses from a query to
Outlook:

Dim db As Database, rs As Recordset, sql As String, emailTo As String
Set db = CurrentDb()
emailTo = ""
sql = "select EmailAdd from qryEmailMerge"
Set rs = db.OpenRecordset(sql)
Do Until rs.EOF
If Not IsNull(rs!EmailAdd) Then
emailTo = emailTo & rs!EmailAdd & "; "
End If
rs.MoveNext
Loop
emailTo = Left(emailTo, Len(emailTo) - 1)
DoCmd.SendObject acSendNoObject, , , , , emailTo

This works well UNTIL I try to use a textbox on an unbound form to
provide "qryEmailMerge" with one or more of its parameters. Is there
a more elegant way around this than writing the results of the query
to a temporary table and then basing "qryEmailMerge" on that table?
Aug 27 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
ARC
What other criteria are you trying to set with the textbox values?

"Wayne" <cq*******@volcanomail.comwrote in message
news:d2**********************************@u33g2000 pro.googlegroups.com...
I'm using the following code to send email addresses from a query to
Outlook:

Dim db As Database, rs As Recordset, sql As String, emailTo As String
Set db = CurrentDb()
emailTo = ""
sql = "select EmailAdd from qryEmailMerge"
Set rs = db.OpenRecordset(sql)
Do Until rs.EOF
If Not IsNull(rs!EmailAdd) Then
emailTo = emailTo & rs!EmailAdd & "; "
End If
rs.MoveNext
Loop
emailTo = Left(emailTo, Len(emailTo) - 1)
DoCmd.SendObject acSendNoObject, , , , , emailTo

This works well UNTIL I try to use a textbox on an unbound form to
provide "qryEmailMerge" with one or more of its parameters. Is there
a more elegant way around this than writing the results of the query
to a temporary table and then basing "qryEmailMerge" on that table?
Aug 29 '08 #2

P: n/a
On Aug 29, 3:16*pm, "ARC" <PCES...@PCESoft.invalidwrote:
What other criteria are you trying to set with the textbox values?

"Wayne" <cqdigi...@volcanomail.comwrote in message

news:d2**********************************@u33g2000 pro.googlegroups.com...
I'm using the following code to send email addresses from a query to
Outlook:
Dim db As Database, rs As Recordset, sql As String, emailTo As String
Set db = CurrentDb()
emailTo = ""
sql = "select EmailAdd from qryEmailMerge"
Set rs = db.OpenRecordset(sql)
Do Until rs.EOF
* *If Not IsNull(rs!EmailAdd) Then
* *emailTo = emailTo & rs!EmailAdd & "; "
* *End If
* *rs.MoveNext
Loop
emailTo = Left(emailTo, Len(emailTo) - 1)
DoCmd.SendObject acSendNoObject, , , , , emailTo
This works well UNTIL I try to use a textbox on an unbound form to
provide "qryEmailMerge" with one or more of its parameters. *Is there
a more elegant way around this than writing the results of the query
to a temporary table and then basing "qryEmailMerge" on that table?
Filtering criteria for the list of people with email addresses. eg.
Company, Location etc.
Aug 29 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.