Results 1 to 2 of 2
  1. #1
    WillTurner is offline Novice
    Windows 10 Office 365
    Join Date
    May 2023
    Posts
    1

    Email a query while selecting recipients from another query

    I have a query post_turn_wheeldiameters that is sent by using a macro and the command EMailDatabaseObject, entering the email addresses in the To box
    Ideally I would like to select recipients from a second query contacts_email_post_turn_dias2, where the field is email_post_turn_dias and the table is contacts_email_post_turn_diameters1. The field would have the value True.
    Is this possible, unfortunately I have little experience of VBA.
    Any help much appreciated, thanks

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,911
    Pretty much anything is possible.
    If I understand you correctly, you need to obtain all the email addresses and concatenate them with a semi coln between them.
    Then use SendObject https://learn.microsoft.com/en-us/of...cmd.sendobject

    Macroes are quite limited IMO, so best start learning VBA.

    I would use your email query as a recordset and use the field in that query with the email addresses to concatenate those addresses, then use the string variable that holds those addresses in the SendObject command.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

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

Similar Threads

  1. Email To Using Multiple Recipients
    By burrina in forum Sample Databases
    Replies: 1
    Last Post: 10-08-2019, 12:43 PM
  2. Replies: 1
    Last Post: 09-24-2014, 07:15 AM
  3. Send email to multiple recipients based on query
    By nablmm in forum Programming
    Replies: 3
    Last Post: 09-11-2014, 05:36 PM
  4. Replies: 3
    Last Post: 09-18-2013, 09:25 AM
  5. Replies: 0
    Last Post: 12-01-2011, 01:38 PM

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