Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2012
    Posts
    1

    VBA help - Sending report to contacts from a query/table

    Hi

    I"m a novice at anything access, so I apologize in advance for my ignorance. I am trying to get access to email a report to email addresses in a query (qry_contacts). Filed Names within the query is called "email". I am able to get access to generate the email, but the only way I can get anything in the "TO" field is if i hard code it in the VBA (type the actual email address in there). Please see below for my code. I appreciate your help in advance. I apologize also, if there are a million examples of this elsewhere. But if you point me to one of them, I'm not going to be able to figure out how that applies to mine. Thanks. Also, I dont know if it matters or not, but I'm using Lotus Notes as my email client.



    Private Sub MAIL_Deferred_DTSR_List_Click()
    On Error GoTo Err_MAIL_Deferred_DTSR_List_Click

    Dim stDocName As String

    stDocName = "rpt_Deferred_DTSR_List_By_Plant"
    DoCmd.SendObject acReport, stDocName, "Rich Text Format"

    Exit_MAIL_Deferred_DTSR_List_Click:
    Exit Sub



    Err_MAIL_Deferred_DTSR_List_Click:
    MsgBox Err.Description
    Resume Exit_MAIL_Deferred_DTSR_List_Click

    End Sub

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    It does matter that you are using Lotus Notes (instead of MS Outlook). In spite of the caveat in your request, I am referring you to example code that you will have to adapt.

    Google: Access VBA lotus notes
    http://www.fabalou.com/VBandVBA/lotusnotesmail.asp

    To batch email to all contacts in a query, will need to open a recordset and loop through the records.
    https://www.accessforums.net/program...ook-21903.html
    http://msdn.microsoft.com/en-us/libr...ffice.12).aspx
    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. Replies: 3
    Last Post: 08-30-2012, 10:27 AM
  2. Sending Report via E-mail Error
    By Nettie in forum Access
    Replies: 8
    Last Post: 04-06-2012, 12:15 PM
  3. Sending Info into A report
    By JayX in forum Access
    Replies: 18
    Last Post: 12-19-2011, 10:06 AM
  4. Limit Query results to 5 contacts per site
    By wobvintage3 in forum Queries
    Replies: 2
    Last Post: 12-01-2010, 12:23 PM
  5. Replies: 0
    Last Post: 07-06-2010, 08:12 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