I have a saved export that should save a PDF of the current report to the user’s desktop…”should” being the key word. Currently I'm getting a "Run Time Error 2302-Microsoft Office Access can't save teh output data to the file you've selected". I can’t seem to figure out what the issue is, so any assistance would be greatly appreciated.
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o> </o>
When the file is opened the path to the user’s desktop is saved to a global variable with the code below:
<o> </o>
<o> </o>
Once the report is opened and the button is pressed, the following code is run:
<o> </o>
End Sub
<o> </o>
As you can tell by the code the import/export is called AF2005Export and the path/directory saved in the saved export list is “UserSavePath\AF2005-Armament.pdf”
<o> </o>
I’m sure there is a relatively simple fix for this, but I’m not seeing it.
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o> </o>
When the file is opened the path to the user’s desktop is saved to a global variable with the code below:
<o> </o>
Code:
UserSavePath = Environ("USERPROFILE") + "\Desktop"
Once the report is opened and the button is pressed, the following code is run:
<o> </o>
Code:
Private Sub PDFExportButton_Click()
DoCmd.RunSavedImportExport ("AF2005Export")
MsgBox ("Successfully exported to " & UserSavePath & "\2005-Armament.xlsx!"), vbInformation, "!!!! SUCCESS !!!!"
<o> </o>
As you can tell by the code the import/export is called AF2005Export and the path/directory saved in the saved export list is “UserSavePath\AF2005-Armament.pdf”
<o> </o>
I’m sure there is a relatively simple fix for this, but I’m not seeing it.