e-mail code

R

rml

I'm using the below code to create an e-mail. It works fine. What I would
like to do is have the e-mail address/s pull from a field/s on the form.
[emailfield]

Can someone show me the code? Thanks.

40 DoCmd.SendObject acSendReport, "Report1", acFormatPDF, "(e-mail address removed);
(e-mail address removed); (e-mail address removed)", , "(e-mail address removed)", "Test Resutls", "Attached are
your results for Report ID - "
 
M

Maurice

Instead of the hardcoded emailadresses refer to the controls on the form that
should do the trick.

So:

40 DoCmd.SendObject acSendReport, "Report1", acFormatPDF,
me.textbox;me.textbox2; me.textbox3, , me.textbox4, "Test Resutls", "Attached
are
your results for Report ID - "

ofcourse you replace the me.textbox for the textbox names you are using.
 
B

Beeyen

Good Day Mr Maurice,

I would like to include the names from two different combo boxes with drop
downs into the To: field and add information from a field on the main form
into the body of the email. Would you know how this can be accomplished?

Maurice said:
Instead of the hardcoded emailadresses refer to the controls on the form that
should do the trick.

So:

40 DoCmd.SendObject acSendReport, "Report1", acFormatPDF,
me.textbox;me.textbox2; me.textbox3, , me.textbox4, "Test Resutls", "Attached
are
your results for Report ID - "

ofcourse you replace the me.textbox for the textbox names you are using.
--
Maurice Ausum


rml said:
I'm using the below code to create an e-mail. It works fine. What I would
like to do is have the e-mail address/s pull from a field/s on the form.
[emailfield]

Can someone show me the code? Thanks.

40 DoCmd.SendObject acSendReport, "Report1", acFormatPDF, "(e-mail address removed);
(e-mail address removed); (e-mail address removed)", , "(e-mail address removed)", "Test Resutls", "Attached are
your results for Report ID - "
 

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

Similar Threads

pdf send 8
rename attachment 1
Can't send e-mails 5
docmd.sendobject 2
Help with sending emails 1
Current Record 2
Unable to send via windows mail 6
Don't want to send mail 6

Top