formatting email addresses

  • Thread starter Thread starter detobias
  • Start date Start date
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!
 
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
 
Back
Top