Results 1 to 5 of 5
  1. #1
    ham355 is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2012
    Posts
    11

    Question Emailing report to address held in field

    Hi all, I am using the code below in a swithboard, to generate and email a report (the email@email.com is replaced with my email address)

    However, I hold email addresses in the query to which the report pulls from, so it would be useful to send the report to the address held in that field. How is that achievable please?

    My field is simply called 'EmailTo' - Thanks! Ian

    Private Sub Option1_Click()
    DoCmd.SendObject _
    acSendReport, _
    "Hosu Raw Query 2", _
    acFormatPDF, _
    "email@email.com", _
    , _
    , _
    "HOSU Report", _


    "Please find attached your latest HOSU Report, Thanks, Ian", _
    False
    End Sub

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Is the report actually open and viewable on-screen when you run the SendObject code? The email address is in a field on the report? This is for a single address? How is the report filtered to single address? Can refer to a variable in place of the literal address text. The variable can be a reference to control on form or report.
    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.

  3. #3
    ham355 is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2012
    Posts
    11
    Hi June, thanks for your reply, but I have managed to figure out a solution!

    Regards

  4. #4
    webisti is offline The Wisher
    Windows XP Access 2003
    Join Date
    Jun 2011
    Posts
    115
    I do have the same issue as in the begining of the thread
    How did u solved it?

    regards

    Webisti

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    In case ham doesn't come back, a clue to possible solution is in my previous post. Refer to control on form as input for the address.

    DoCmd.SendObject _
    acSendReport, _
    "Hosu Raw Query 2", _
    acFormatPDF, _
    Me.controlname, _
    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. Emailing a report
    By prv in forum Access
    Replies: 1
    Last Post: 12-20-2010, 04:03 PM
  2. Replies: 3
    Last Post: 05-06-2010, 03:26 PM
  3. Replies: 1
    Last Post: 10-07-2009, 08:15 AM
  4. Input Mask for an IP Address and Mack Address
    By baksg1995 in forum Access
    Replies: 18
    Last Post: 06-23-2009, 12:33 PM
  5. Replies: 1
    Last Post: 05-01-2009, 07:33 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