Results 1 to 3 of 3
  1. #1
    arich6211 is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2018
    Posts
    1

    Question How to send an Email based on Query Results

    Hello, I am new to access. I am using it as an insurance tracker/maintenance contract tracker for tenants and vendors for real estate. I have a table for vendors and one for tenants and then I have a query that pulls the ones that are 30 days out from going overdue or that dont have a certificate of insurance into me yet (so I know whom I have to contact to get an updated copy). What I would love to be able to do is somehow have a way to auto send a generic email template to the email address for the tenants/vendors that are in the query warning them to get their updated certificate in immediately. Curious how to do that? If possible I would like it to actually take the attachment of the COI that I have on file (in the table that the query pulls from) and put that as an attachment in the email as well, so they have a reference copy to work off of.

    Please help or let me know if any of this is even possible!

    Thank you.

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,800
    Are you still waiting or has this been answered elsewhere?
    BTW - having attachments in an Access db is not advised. You don't say where the table is, so I'm making that assumption.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,921
    There are many examples of VBA code to accomplish what you describe. Open recordset object in VBA, loop through the recordset, use SendObject method to send an email message to address in the recordset record.

    Cannot use SendObject method to attach files to email. Requires code that opens and manipulates Outlook objects.
    If you save COI in an attachment field in table, code would have to extract the file to external folder then attach that file to email.
    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.

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

Similar Threads

  1. Send email to multiple recipients based on query
    By nablmm in forum Programming
    Replies: 3
    Last Post: 09-11-2014, 05:36 PM
  2. Replies: 6
    Last Post: 03-19-2014, 03:53 PM
  3. Replies: 2
    Last Post: 04-08-2013, 09:05 AM
  4. Use Query Results to send Email
    By Paul Ager in forum Programming
    Replies: 2
    Last Post: 05-05-2011, 09:57 AM
  5. Replies: 1
    Last Post: 03-09-2011, 08:54 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