Go Back   Access World Forums > Microsoft Access Discussion > General

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 11-09-2018, 08:29 PM   #1
rainbows
Newly Registered User
 
Join Date: Apr 2017
Posts: 64
Thanks: 11
Thanked 0 Times in 0 Posts
rainbows is on a distinguished road
CC on email

hi ,
I have many reports that need to be CC to many people
I have put this in my embedded macro

Code:
=DLookUp("[E-mail Address]","Contacts","[ID]=" & Nz([Assigned To],0))
is it possible that I can put a code against each contact for each report
and just call up that code in the embeded macro ?

thanks

steve

rainbows is offline   Reply With Quote
Old 11-09-2018, 11:49 PM   #2
Ranman256
Newly Registered User
 
Join Date: Apr 2015
Location: KY,USA
Posts: 3,139
Thanks: 0
Thanked 683 Times in 668 Posts
Ranman256 will become famous soon enough Ranman256 will become famous soon enough
Re: CC on email

cycle thru the email list, collect the names, then put list in the .TO property:

in a form is a listbox
the list is a query of the names to send to
this cycles thru the list, collects the names, then sends the report
text boxes hold the report name, email body, and subject

Code:
sub btnSend_click()
dim vTo
dim i as integer
dim sToList as string

for i = 0 to lstBox.listcount -1
    vTo = lstBox.itemdata(i)    'get next email in listbox
    lstBox = vTo		'set the listbox to this item

    sToList = sToList & ";" & vTo    
next

   docmd.SendObject acSendReport ,txtReport,acFormatPDF, sToList,,,txtSubj,txtBody

end sub
Ranman256 is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] VBA Code on Subform to Lookup Email field on table and launch email skoolz Queries 3 07-07-2015 05:51 AM
insert HtML file in to body of email (inside loop email) GaryPanic Modules & VBA 9 05-06-2015 12:56 AM
Query records by me!date then email results in body of email on button click TWIRCH75 Modules & VBA 3 02-27-2014 09:10 AM
Send report to email & insert email address off current form MichaelWaimauku Forms 17 12-11-2012 06:32 PM
Email from Access 2010 runtime / Server 2008 without an email client Cloyce Modules & VBA 0 05-15-2012 10:08 AM




All times are GMT -8. The time now is 08:38 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Sponsored Links

How to advertise

Media Kit


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World