Consulting

Results 1 to 5 of 5

Thread: DoCmd.OutputTo works in .adp file but not .accdb file

  1. #1
    VBAX Regular
    Joined
    May 2015
    Posts
    87
    Location

    DoCmd.OutputTo works in .adp file but not .accdb file

    I am rebuilding a database as a .accdb file instead of .adp file so it will work in Access 2013 and I get a Property not found error on this line trying to transfer results from a view into an excel file. This code works in the .adp file.

    'Export the open issues query results (created view in SQL server)
    [CODE][CODE]DoCmd.OutputTo acOutputServerView, "dbo.Issue Open 3", "ExcelWorkbook(*.xlsx)", "I:\Groups\ccuser\Finance\Collection Control\Open Issues\OpenIssuesReport.xlsx", False, "", , acExportQualityPrint
    Last edited by cleteh; 04-25-2017 at 01:17 PM.

  2. #2
    Try changing "ExcelWorkbook(*.xlsx)" to acFormatXLS

    DoCmd.OutputTo acOutputServerView, "dbo.Issue Open 3", acFormatXLS, "I:\Groups\ccuser\Finance\Collection  Control\Open Issues\OpenIssuesReport.xls", False, "", ,  acExportQualityPrint
    Boyd Trimmell aka HiTechCoach
    Microsoft Access MVP -2010-2015

    Programming: Nine different ways to do it right, a thousand ways to do it wrong.
    Binary--it's as easy as 1-10-11

  3. #3
    You might also want to look into using the DoCmd.TrasferSpreadsheet
    Boyd Trimmell aka HiTechCoach
    Microsoft Access MVP -2010-2015

    Programming: Nine different ways to do it right, a thousand ways to do it wrong.
    Binary--it's as easy as 1-10-11

  4. #4
    The ObjectType acOutputServerView is only available in ADP-Projects. You need to either link the view to your Access database as a table or create a local query replicating the view. Then use the ObjectType acOutputTable or acOutputQuery.

  5. #5
    VBAX Regular
    Joined
    May 2015
    Posts
    87
    Location
    Thanks Phil, I did find that I need to link my views located in SQL Server

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •