formatting email addresses

D

detobias

I have a growing database in Access with one field email addresses. How do I
easily create a list of the email addresses with commas between them in order
to send a bulk email? I have tried this in Word by copying emails into a
table then adding a column of commas and converting to text, but that does
not work. I have added commas each time which is painful, especially as my
DB grows! Thanks in advance!
 
P

pietlinden

I have a growing database in Access with one field email addresses.  How do I
easily create a list of the email addresses with commas between them in order
to send a bulk email?  I have tried this in Word by copying emails intoa
table then adding a column of commas and converting to text, but that does
not work.  I have added commas each time which is painful, especially as my
DB grows!  Thanks in advance!

Function EMailList() As String
dim strTemp as string
dim rs as dao.recordset
set rs=dbengine(0)(0).OpenQueryDef("SelectQueryName")

do until rs.EOF
strTemp = strTemp & "," & rs.Fields("EMail")
rs.movenext
Loop
rs.Close
set rs=nothing

'strip off the extra leading comma...
strtemp=right$(strTemp,Len(strTemp)-1)

EMailList=strTemp
End Function
 

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