Generate an email from an access field to multiple users

K

kharrison

I have a query with a field that contains email addresses. If I click on an
individual email address it will open my email program and place the address
in the To field.

What I would like to do is have all the email addresses in that column
appear in the To field. Is this possible. I have very minimal coding
expertise.

Thanks for your help
Kris
 
D

Damian S

Hi Kris,

You will need to separate your email addresses with a semi colon, so in a
function, open a recordset containing your email addresses, and append each
address to a string variable with a semi colon. Then return that variable
from your function, and hey presto you have a list of email addresses to use.

eg:
function GetEmailAddresses() as string
dim db as database
dim rst as recordset
dim strEmail as string

set db = currentdb
set rst = db.openrecordset("select EmailAddress from tblEmail")
strEmail = ""

do while not rst.eof
strEmail = strEmail & rst("EmailAddress") & "; "
rst.movenext
loop

GetEmailAddresses = strEmail

end function

Hope this helps.

Damian.
 
K

kharrison

Damian

Thanks for your response. As I am a bit light on in my coding expertise,
where do I need to be to do this Function??

Kris
 
Top