Results 1 to 3 of 3
  1. #1
    slimjen is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    727

    Export report

    All, this is a cross post because I was n the wrong forum..smh..anyway, using access 2016...I have a report based on a query I need users to export to a folder on the desktop.The button is on the form. It runs but just places the field names in the columns with no data. Also On the left side there's the numbers 123 like its tring to group something.
    Here is the code I'm using:
    Code:
    [Private Sub Export_QA_Report_Click()
    On Error GoTo Err_Export_QA_Report_Click

    Dim reportname As String
    Dim theFilePath As String
    reportname = "rptQAReport"
    theFilePath = "C:\Documents and Settings" & Environ("UserName") & "\Desktop\Reports"
    theFilePath = theFilePath & reportname & "_" & Format(Date, "yyyy-mm-dd") & ".xls"


    DoCmd.OutputTo acOutputReport, reportname, acFormatXLS, theFilePath, True
    MsgBox "Look on your desktop for the report."


    Exit_Export_QA_Report_Click:
    Exit Sub

    Err_Export_QA_Report_Click:
    MsgBox Err.Description


    Resume Exit_Export_QA_Report_Click

    End Sub
    If this isn't possible, please show me how to export the query based on the forms filter instead. Thank you

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    DONT export reports to xls, instead use acFormatPDF,
    do export queries to xls.

    so either export the query (in the report) to xls,
    or the report to pdf.

  3. #3
    slimjen is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    727
    Thanks..got it resolved

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

Similar Threads

  1. Export Report To PDF
    By ekoziko in forum Access
    Replies: 8
    Last Post: 04-06-2018, 02:16 PM
  2. Export Report to PDF
    By Ganymede in forum Import/Export Data
    Replies: 2
    Last Post: 03-16-2016, 08:55 AM
  3. Export Report to PDF
    By cuddles in forum Reports
    Replies: 10
    Last Post: 05-21-2014, 09:28 AM
  4. export report
    By slimjen in forum Forms
    Replies: 7
    Last Post: 04-24-2013, 08:14 AM
  5. Export report to jpg
    By isdm in forum Reports
    Replies: 1
    Last Post: 04-16-2010, 10:00 PM

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