Results 1 to 2 of 2
  1. #1
    Telejazzer is offline Novice
    Windows 8 Access 2007
    Join Date
    Nov 2014
    Posts
    4

    Post Emailing Multiple Queries to Multiple Email

    Hi All,

    I'm new this forum and I've been using Excel for a while before starting a new job and recently start using Access again. I'm finding it more useful specially with call logs and analysis.
    I just started sending emails of queries to multiple emails from the database.



    I basically wish to:

    Run a query for a particular employee and email the result of that query to that employee then go to the next query for the next employee to send.

    In other words:


    While Table of Employees not empty
    Run Query for Employee (1)
    Email the result of the Query to Employee (1)
    End Do

    It might just be a simple solution but I'm kinda stuck at the moment. Would appreciate any input.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    Have a listbox on the form with those you want to email.
    Scroll thru the list , send as you go.

    Code:
    Sub SendListEmails()
    Dim vTo, vBody, vSubj, vRpt
    For i = 0 To lstBox.ListCount - 1
      lstBox = lstBox.ItemData(i)
      vRpt = lstBox
      vSubj = "Subject:" & lstBox.Column(1)
      vTo = lstBox.Column(2)
      vBody = "message body"
      
      DoCmd.SendObject acSendQuery, "qsQuery1", acFormatXLS, vTo, , vSubj, vBody
      DoCmd.SendObject acSendQuery, "qsQuery2", acFormatXLS, vTo, , vSubj, vBody
    Next
    End Sub

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

Similar Threads

  1. email multiple reports to multiple recipients
    By slimjen in forum Programming
    Replies: 5
    Last Post: 08-31-2014, 11:52 AM
  2. Replies: 3
    Last Post: 10-18-2013, 07:29 AM
  3. Replies: 7
    Last Post: 07-11-2013, 10:05 AM
  4. Export to PDF and Email multiple PDF's per email
    By greyoxide in forum Reports
    Replies: 1
    Last Post: 04-20-2012, 08:49 AM
  5. Replies: 1
    Last Post: 01-10-2012, 10:12 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