Results 1 to 3 of 3
  1. #1
    Edley7 is offline Novice
    Windows XP Access 2003
    Join Date
    May 2011
    Posts
    1

    Is access 2010 better for emailing reports?

    Hi, I'm a small business owner in the UK with 3 employees and considering upgrading from Access 2003 to Access 2010.



    We use a bespoke access database to handle bookings (we're a travel company) and find the 2003 version very poor when it comes to emailing a report to clients and suppliers - we currently publish the rpt to word then cut and paste into an email but formatting is lost or changed and it's generally unsatisfactory.

    Has Access 2010 improved any of this?

    Many thanks

  2. #2
    NoellaG's Avatar
    NoellaG is offline VIP
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,044
    Hi,

    even with Access 2003 you could send a mailing with attached report. Example: for each customer I first create a PDF file (for Access 2003 you had to download an add-in to be able to do this but with the constant acFormatSNP you can create a snapshot file), then create and send a mail message to all customers with the created file as attachment.

    Example:

    create PDF
    Code:
    strFile = [get or type here the location for the file and the filename]  & Format(Now, "YYYYMMDD_hms") & ".pdf"
    DoCmd.OutputTo acOutputReport, strR & "_PDF", acFormatPDF, strFile, False
    Send mail:
    Code:
    Public Function CreateMailMessage(strTo As String, strSubject As String, strBody As String, strFile As String) As Boolean
    On Error GoTo Err_CreateMailMessage
    
        Dim appOutlook As New Outlook.Application
        Dim msg As Outlook.MailItem
        Dim intpos As Integer
        
        Set msg = appOutlook.CreateItem(olMailItem)
        
        intpos = InStr(1, strTo, "#")
        If intpos > 1 Then strTo = Left(strTo, intpos - 1)
        msg.To = strTo
        msg.Subject = strSubject
        msg.Body = strBody
        msg.Attachments.Add (strFile)
        msg.Display
        
        CreateMailMessage = True
    
    Exit_CreateMailMessage:
        Exit Function
        
    Err_CreateMailMessage:
        Debug.Print Err.Number & ": " & Err.Description
        CreateMailMessage = False
        Resume Exit_CreateMailMessage
    
    End Function
    greetings
    NG

  3. #3
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    A Report itself is an Access object intended to be viewed by users of the Access database. Which maybe is why your process today is a bit of a kludge....

    Beginning with Access07 there is now a native export to pdf (you find that icon in the ribbon - no programming required). It is the pdf that one attaches to the email to send. I think you'll find it works good.

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

Similar Threads

  1. Replies: 7
    Last Post: 03-16-2011, 05:09 PM
  2. 2010 and 2007 Access Queries, Forms & Reports
    By rpaldridge in forum Import/Export Data
    Replies: 3
    Last Post: 02-11-2011, 07:37 AM
  3. 2010 Access reports
    By wthoffman in forum Reports
    Replies: 3
    Last Post: 10-12-2010, 09:36 AM
  4. EMailing Through Access
    By mamta in forum Programming
    Replies: 5
    Last Post: 02-15-2010, 01:07 PM
  5. Emailing forms or reports
    By dcecil in forum Reports
    Replies: 6
    Last Post: 12-16-2009, 07:57 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