473,382 Members | 1,480 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Help Needed With Sending Email Addresses To Outlook

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
2 1612
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: NotGiven | last post by:
The code below is designed to loop through rows of a database query obtaining email addresses and send an email to each. It is modified form fomr some code I found on the net. With each while...
1
by: Pablo | last post by:
Hi, there, I have a table which has a field (Email) populated with Email address. I am trying to send email using MS Outlook to those addresses. Everything works fine except that a warning message...
1
by: Devonish | last post by:
I am composing an email with Access VB and then sending it from within Access. Everything works correctly (the email actually goes!) but Outlook ask some irritating questions that the user is...
8
by: WindAndWaves | last post by:
Hi Gurus I am trying to send a newsletter from Access. Can anyone tell me what is the simplest way to send an email from Access? I would prefer not to use outlook, because this gives me all...
7
by: Marcin | last post by:
Hello all! A few years ago I created a form with button which let me send an email with an attachment. It was created in Access 97. Now I would like to move this application into Access 2003....
3
by: scott_baird | last post by:
I have an email macro setup (maybe I should go another way, but that was the quickest at the moment...) and what I would like to do is automate the "to" addressee of the email it generates for...
3
by: IGD | last post by:
I don't know if this is the right place to post this or not. If not, could someone direct me elsewhere where I would find more information on how to solve my problem? Thanks! My problem is this:...
4
by: Ima Lozer | last post by:
I am in the process of writing an app for one of my sites that will allow guests to send e-cards to other folks. The process is fairly simple. First the sender selects a card graphic via a series...
0
by: brossyg | last post by:
I have some VBA code that creates an email in Access and sends it from Outlook. It is based on a query with a list of email addresses. It sends the first email to Outlook and then I have to manually...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.