e-mail code

  • Thread starter Thread starter rml
  • Start date Start date
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 - "
 
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.
 
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 - "
 
Back
Top