Concatenate email addresses

B

Bonnie A

Hi everyone. Using A02 on XP. I know this is possible but I just cannot
find it. I have searched all through here. Most of the concatenate posts do
not apply to what I need. The link to Roger's Library also does not. They

I need to create a text string from ALL RECORDS IN ONE FIELD so I can send a
group email.

My table has a field [EmailAddr], I have over 200 records and would like to
get this:

(e-mail address removed),[email protected],[email protected],[email protected],[email protected],etc.

I know it's an easy one but cannot figure it out. The best I can find is
this mention about the article in Roger's Library from John Nurick to Eli the
Iceman back on May of 2006:

"That concatenates values in multiple fields from the current record;
Eli's question implied concatenating values in one field of multiple
records. "

The post did not answer the question though. It only identified it. But I
need the answer.

Can someone help?

Thank you in advance for your time and advice!

Bonnie
 
D

Duane Hookom

Rather than create a single function for a single use, there is a generic
concatenate function with sample usage at
http://www.rogersaccesslibrary.com/forum/forum_posts.asp?TID=16.
--
Duane Hookom
Microsoft Access MVP


NuBie via AccessMonster.com said:
You need to loop thru all records and get each email address and then
CONCATENATE :
This is how i do it:

Dim db As DAO.Database
Dim rst As DAO.Recordset

Set db = CurrentDb()
Set rst = db.OpenRecordset("Select emailadd from yourTable")
If rst.RecordCount = 0 Then
MsgBox "No Record In the Table"
rst.Close
Set rst = Nothing
Set db = Nothing
Else
With rst

.MoveFirst
Do While Not .EOF
emailadd = emailadd & !emailadd & ", "
.MoveNext
Loop
.Close
End With
End If

Set rst = Nothing
Set db = Nothing


NOTE: remove the extra comma ","

Bonnie said:
Hi everyone. Using A02 on XP. I know this is possible but I just cannot
find it. I have searched all through here. Most of the concatenate posts do
not apply to what I need. The link to Roger's Library also does not. They

I need to create a text string from ALL RECORDS IN ONE FIELD so I can send a
group email.

My table has a field [EmailAddr], I have over 200 records and would like to
get this:

(e-mail address removed),[email protected],[email protected],[email protected],[email protected],etc.

I know it's an easy one but cannot figure it out. The best I can find is
this mention about the article in Roger's Library from John Nurick to Eli the
Iceman back on May of 2006:

"That concatenates values in multiple fields from the current record;
Eli's question implied concatenating values in one field of multiple
records. "

The post did not answer the question though. It only identified it. But I
need the answer.

Can someone help?

Thank you in advance for your time and advice!

Bonnie

--
spread the WORD

Message posted via http://www.accessmonster.com

.
 
B

Bonnie A

Hi NuBie! Thanks so much for the reply. Sorry I took so long to check it.

So I need to take your code and create a new MODULE? Then name it, compile
it and then create a button on a form to run it?

I need a quick paragraph on 'what to do with what you gave me'. It would
give me the trail to follow WITH the tool provided.

Thank you very much for your time and the wonderful reply. I just need to
be sure what to do with it. I know I need to be sure I use MY table name and
MY field name. I'm okay with that.

It doesn't look like an expression, it looks like module VB. I just don't
get in there much but being able to do this would so much help me with
notifying clients in bulk rather than copy and paste myself ill.

Thanks again!
--
Bonnie W. Anderson
Cincinnati, OH


NuBie via AccessMonster.com said:
You need to loop thru all records and get each email address and then
CONCATENATE :
This is how i do it:

Dim db As DAO.Database
Dim rst As DAO.Recordset

Set db = CurrentDb()
Set rst = db.OpenRecordset("Select emailadd from yourTable")
If rst.RecordCount = 0 Then
MsgBox "No Record In the Table"
rst.Close
Set rst = Nothing
Set db = Nothing
Else
With rst

.MoveFirst
Do While Not .EOF
emailadd = emailadd & !emailadd & ", "
.MoveNext
Loop
.Close
End With
End If

Set rst = Nothing
Set db = Nothing


NOTE: remove the extra comma ","

Bonnie said:
Hi everyone. Using A02 on XP. I know this is possible but I just cannot
find it. I have searched all through here. Most of the concatenate posts do
not apply to what I need. The link to Roger's Library also does not. They

I need to create a text string from ALL RECORDS IN ONE FIELD so I can send a
group email.

My table has a field [EmailAddr], I have over 200 records and would like to
get this:

(e-mail address removed),[email protected],[email protected],[email protected],[email protected],etc.

I know it's an easy one but cannot figure it out. The best I can find is
this mention about the article in Roger's Library from John Nurick to Eli the
Iceman back on May of 2006:

"That concatenates values in multiple fields from the current record;
Eli's question implied concatenating values in one field of multiple
records. "

The post did not answer the question though. It only identified it. But I
need the answer.

Can someone help?

Thank you in advance for your time and advice!

Bonnie

--
spread the WORD

Message posted via http://www.accessmonster.com

.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top