Results 1 to 4 of 4
  1. #1
    Trace is offline Novice
    Windows 10 Office 365
    Join Date
    Sep 2022
    Posts
    12

    How To Generate Email to Person Specified in Combo Box and CC Persons in a Table or Query?

    Hello! I have a form in which users will enter safety activities.



    Based on the user's selection for "Initiator", the "Submit To" combo box (cboSupervisor) selects their supervisor, to whom the email should be sent once the "Send Email" button is clicked. The supervisor will be different depending on the user/initiator.

    The row source for cboSupervisor is qryEmployeesandSupervisors, which is built from tblEmployees, and this table includes the supervisor emails.

    Question 1 is: How do I get the supervisor email to be included into code for the email?

    Question 2: I have a query listing all members of a Safety team that need to be cc'ed on the email. This list may change periodically as people join or leave the team, and it's based off a yes/no box in tblEmployees. How do I get these people to be cc'ed in the email?

    Please let me know what if any additional information is needed and thanks in advance for helping!!

  2. #2
    Micron is online now Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    1) If the combo contains email address you can refer to it by column number (zero based, so second column number is one ( 1 ))

    2) your email cc list query only returns the checkboxes that are checked, no? If so then I don't understand the question since that would mean those who have left are not included in the query results.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    Trace is offline Novice
    Windows 10 Office 365
    Join Date
    Sep 2022
    Posts
    12
    Hi Micron, and thanks for the reply.
    The combo box DOESN'T contain the email address, just the supervisor's name, but based on this answer I could point to another column in the same table that the query is based on.

    Yes, the query only returns "True" results, meaning personnel who are on that particular team. I'd like to know how to get that set of people included in the email CC.

  4. #4
    Micron is online now Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    Sounds like you'd need to loop over a recordset that contains email addresses
    https://stackoverflow.com/questions/...ailored-emails
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Replies: 3
    Last Post: 01-14-2021, 09:45 AM
  2. Replies: 1
    Last Post: 05-23-2018, 09:35 AM
  3. Replies: 5
    Last Post: 07-28-2014, 04:05 PM
  4. Replies: 1
    Last Post: 05-01-2014, 11:37 AM
  5. Send email to persons returned in a query
    By Remillard in forum Programming
    Replies: 2
    Last Post: 04-04-2013, 10:15 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