473,402 Members | 2,050 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,402 software developers and data experts.

Create long string from query result?

I'm trying to create an email mailing list for Outlook.

Here's the part of the sub that puts the email address in the Bcc (or To)
field:

With objNewMail
.BCC = strEmail
.Display
End With

I'm wondering if I can create one long comma-delimited string for "strEmail"
that is the result of a query.

.... was also thinking a For loop might work... ???

any help is greatly appreciated!

Nov 12 '05 #1
3 5643
I think this might work...

Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("qryEmailList")
Do Until rst.EOF
strEmail = strEmail & rst!EmailAddress & ";"
rst.MoveNext
Loop
rst.Close
Set rst = Nothing
"deko" <dj****@hotmail.com> wrote in message
news:92****************@newssvr27.news.prodigy.com ...
I'm trying to create an email mailing list for Outlook.

Here's the part of the sub that puts the email address in the Bcc (or To)
field:

With objNewMail
.BCC = strEmail
.Display
End With

I'm wondering if I can create one long comma-delimited string for "strEmail" that is the result of a query.

... was also thinking a For loop might work... ???

any help is greatly appreciated!

Nov 12 '05 #2
"deko" <dj****@hotmail.com> wrote in message news:<3H*******************@newssvr25.news.prodigy .com>...
I think this might work...

Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("qryEmailList")
Do Until rst.EOF
strEmail = strEmail & rst!EmailAddress & ";"
rst.MoveNext
Loop
rst.Close
Set rst = Nothing

Yes, you could either do that or just add the address to the
Recipients collection (any of Cc, Bcc, or To) BTW, I think your
strEMail line should be

Do Until rst.EOF
strEMail = strEMail & ";" rst!EMailAddress
rst.MoveNext
Loop
rst.Close
set rst=nothing

strEMail = right$(strEMail,Len$(strEMail)-1)) ... cuts off the first ;
Nov 12 '05 #3
thanks for the tip.

I tried adding each email to the Bcc collection - but couldn't for some
reason. that's why I resorted to this method...

"Pieter Linden" <pi********@hotmail.com> wrote in message
news:bf**************************@posting.google.c om...
"deko" <dj****@hotmail.com> wrote in message

news:<3H*******************@newssvr25.news.prodigy .com>...
I think this might work...

Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("qryEmailList")
Do Until rst.EOF
strEmail = strEmail & rst!EmailAddress & ";"
rst.MoveNext
Loop
rst.Close
Set rst = Nothing

Yes, you could either do that or just add the address to the
Recipients collection (any of Cc, Bcc, or To) BTW, I think your
strEMail line should be

Do Until rst.EOF
strEMail = strEMail & ";" rst!EMailAddress
rst.MoveNext
Loop
rst.Close
set rst=nothing

strEMail = right$(strEMail,Len$(strEMail)-1)) ... cuts off the first ;

Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Dave | last post by:
I have an application where I am providing the user the ability to select or create a folder on a domain, using SHBrowseForFolder. When the user selects/creates a folder on a remote computer, it...
7
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I...
3
by: Miguel Dias Moura | last post by:
Hello, I am calling an ASP.NET / VB as follows: search.aspx?search=asp%20book%20london Then I create a string with the keywords like this: Dim keywords() As String =...
3
by: shiranaomi | last post by:
I'm wondernig if it's possible to do the following: I'd like to average every 2 numeric values in a table as they appear sequentially ordered by their time stamps. I was thinking the only way to...
23
by: sandy | last post by:
I need (okay, I want) to make a dynamic array of my class 'Directory', within my class Directory (Can you already smell disaster?) Each Directory can have subdirectories so I thought to put these...
4
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is...
15
by: harvey | last post by:
How do I make PHP create a database for mysql please? I can see how to make tables and I have read all the documents I can find but I don't understand how to make the database itself. All...
4
by: Vlad | last post by:
I am having problems using the file.create method within a function that is called when looping through an array of filepaths. If I call my function with a hardcoded file path --C:\Temp.txt the...
7
by: wozza | last post by:
hi I'm a Dreamweaver user who's created a few simple data entry/ registrations forms in my time, but I'm not really a coder (though I can follow instructions and am not afraid to dabble...) - I...
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: 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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.