MustangPriMe
IS-IT--Management
I'm in the process of updating an ADP created in Access 2000, to work in Access 2007.
One of the problems which has cropped up surrounds the OutputTo method.
This line previously worked prefectly in Access 2000:
DoCmd.OutputTo acOutputServerView, "EXEC sp_SubEventAttendance " & cmbEventID, acFormatXLS, "X:\Workfolders\Filename.xls", True
In Access 2007 that results in "Run-time error '156'. Incorrect syntax near the keyword 'FROM'"
Changing the code to:
DoCmd.OutputTo acOutputStoredProcedure, "sp_SubEventAttendance", acFormatXLS, "X:\Workfolders\Filename.xls", True
...works but prompts for the ID. If I try to include it in the code, another error "Run-time error '208'. Invalid object name 'sp_SubEventAttendance 76'" is returned.
Any idea how I can get this previously-working function working once again? (i.e. exporting of the results of a stored procedure with a parameter to excel)
Thanks
Paul
One of the problems which has cropped up surrounds the OutputTo method.
This line previously worked prefectly in Access 2000:
DoCmd.OutputTo acOutputServerView, "EXEC sp_SubEventAttendance " & cmbEventID, acFormatXLS, "X:\Workfolders\Filename.xls", True
In Access 2007 that results in "Run-time error '156'. Incorrect syntax near the keyword 'FROM'"
Changing the code to:
DoCmd.OutputTo acOutputStoredProcedure, "sp_SubEventAttendance", acFormatXLS, "X:\Workfolders\Filename.xls", True
...works but prompts for the ID. If I try to include it in the code, another error "Run-time error '208'. Invalid object name 'sp_SubEventAttendance 76'" is returned.
Any idea how I can get this previously-working function working once again? (i.e. exporting of the results of a stored procedure with a parameter to excel)
Thanks
Paul