Link to home
Start Free TrialLog in
Avatar of Karen Schaefer
Karen SchaeferFlag for United States of America

asked on

Export Access 2010 report as XPS file type via Code

I have created a button on form to export a report and save report to specified file location, however, the file does not seem to be there after running the code.   When I Manual export the file as XPS type it works great.  What am I missing?

Private Sub cmdExportReq_Click()
On Error GoTo cmdExportReq_Click_Err
    DoCmd.OutputTo acOutputReport, "rptRequirementMainQuestions", acFormatXPS, "Z:\Access Database Design\Requirement Documentation\RequirementMain.xps", True

cmdExportReq_Click_Exit:
    Exit Sub

cmdExportReq_Click_Err:
    MsgBox Error$
    Resume cmdExportReq_Click_Exit

End Sub

Open in new window


I have tried for True and false to display the results.  Neither seem to give me the correct results.
ASKER CERTIFIED SOLUTION
Avatar of omgang
omgang
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Karen Schaefer

ASKER

thanks this helped