All, Using 2010. I am working on a database that was created in 2003. I created a form with a button to export a report to the users desktop in a folder name "Reports". Both the user and myself have access 2010 running on a win 7 machine. When I click the button; the code runs as expected and exports the report in the folder. When the user clicks the button, they get an error :"...can't save the output data to the file you've selected." Here's the code:
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
Why can't the users run it and I can?
Thanks