Results 1 to 4 of 4
  1. #1
    ertweety is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2012
    Posts
    10

    Export First Page of Report for Each Unique Header

    Currently, I have a report that is grouped at a vendor# level and is producing the same report three times for each vendor. There are 3 lines of data in the source data for each vendor and this is why the report is producing 3 reports for each vendor. Unfortunately, there is really nothing I can do to change the data. I wrote it in SQL and brought it into Access in order to produce the report.

    My question is that since the report is repeated 3 times for each vendor, is there a way only to export the first page of the report for each vendor?

    Here is my code;

    Option Compare Database
    Function exp()
    Dim rsDat As Recordset
    Set rsDat = CurrentDb.OpenRecordset("Select distinct [VENDOR#] From [EDISPATCH_TOWERS]")
    rsDat.MoveFirst
    Do


    DoCmd.OpenReport "rpt_scorecards", acViewPreview, , "[VENDOR#] = '" & rsDat(0) & "'"
    DoCmd.OutputTo acOutputReport, "rpt_scorecards", acFormatPDF, "C:\ACCOUNT_" & rsDat(0) & ".pdf"
    DoCmd.Close acReport, "rpt_scorecards", acSaveNo
    rsDat.MoveNext
    Loop Until rsDat.EOF
    MsgBox "Tower Scorecards Exported"
    End Function

    cross-post http://www.access-programmers.co.uk/...d.php?t=227615
    Last edited by ertweety; 06-05-2012 at 07:42 AM.

  2. #2
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529

  3. #3
    ertweety is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2012
    Posts
    10
    Can anybody help me????????

  4. #4
    ertweety is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2012
    Posts
    10

    Database


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

Similar Threads

  1. Export Data for Distinct Value from Report Header
    By ertweety in forum Programming
    Replies: 6
    Last Post: 06-04-2012, 05:09 PM
  2. Replies: 1
    Last Post: 02-28-2012, 05:05 PM
  3. Replies: 3
    Last Post: 08-07-2011, 09:22 PM
  4. Landscape Page header on a Report
    By Alan1 in forum Reports
    Replies: 2
    Last Post: 07-25-2011, 03:25 AM
  5. Report Header on Each Page
    By nweird in forum Reports
    Replies: 1
    Last Post: 07-24-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