Results 1 to 4 of 4
  1. #1
    bfryxell is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Apr 2015
    Posts
    5

    Concatenating email addresses from a subform and using them in the CC field of a macro


    I have been working on a database for chamber music and there is a form set up where a chamber group can be selected. The group's contact person is shown, as well as the coach(es). Below that, there is a subform that shows the members of the group, with each record having an "Email" field. When a chamber group is selected using a list box that is on the form, that subform is automatically populated. Once the subform is populated, there should be a way to email a report to the group members and coaches. I already have it set up so that a report can be attached to a message in Outlook and addressed to the contact person of the group, but I would like for there to be a way to concatenate the email addresses of all of the group members shown in the subform when the button is clicked to attach the report to an email message, and to use the concatenated string of email addresses in the "To:" field of the message. Thanks very much in advance for any assistance!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Requires VBA code to cycle through records and build the address string.

    Do you want to use SendObject method?

    Common topic. Search forum.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    Put a list box on the form, that has the list of emails in it.
    then cycle Thu them and either send X emails ,or append a string X times to send 1 email.

    Code:
    dim sTo as string
    
    for I = 0 to lstEmails.listcount -1
       LstEmails = LstEmails.itemdata(I)
      sTo = sTo & lstEmails & ";"
    next 
    'send email here
    Last edited by ranman256; 05-07-2015 at 03:38 AM.

  4. #4
    bfryxell is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Apr 2015
    Posts
    5
    I got it basically working, I think. Thank you both for responding!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Send email using CDO, get email addresses from table
    By marvinac1 in forum Programming
    Replies: 3
    Last Post: 12-22-2014, 12:54 PM
  2. Replies: 3
    Last Post: 08-16-2013, 04:15 PM
  3. Replies: 3
    Last Post: 03-30-2012, 10:50 AM
  4. send email to email addresses in database?
    By cnstarz in forum Access
    Replies: 5
    Last Post: 03-02-2011, 09:46 PM
  5. Combining two Email Addresses
    By Frodo in forum Access
    Replies: 0
    Last Post: 09-16-2007, 07:07 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums