Results 1 to 4 of 4
  1. #1
    uoghk is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Jan 2022
    Posts
    149

    Output one PDF for each client to email

    I have a table of sales transactions for all clients.


    I want to loop through this table, to email each client a PDF file.
    I use below command to generate PDF.
    Code:
    Docmd.OutputTo acReport, "ClientTransactionsReport", acFormatPDF, "C:\Temp\ClientTran.pdf"
    But it generate all clients' transaction into 1 PDF.
    How to output 1 PDF for each client?
    Thanks.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Common topic. Code steps:

    1. open a recordset of clients

    2. loop through recordset to open report filtered by ClientID in record

    3. DoCmd.SendObject

    4. close report

    5. move to next record

    6 repeat

    https://www.accessforums.net/showthr...ultiple+emails
    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
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,250

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,556
    Even look at the Similar Threads links at the bottom of this thread.?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

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

Similar Threads

  1. Replies: 5
    Last Post: 04-19-2016, 09:26 PM
  2. Replies: 29
    Last Post: 12-17-2014, 08:46 PM
  3. Replies: 3
    Last Post: 11-25-2014, 01:14 PM
  4. Replies: 3
    Last Post: 09-19-2014, 07:58 AM
  5. Replies: 41
    Last Post: 12-03-2013, 04: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