Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access 2007 project migration - OutputTo method problem

Status
Not open for further replies.

MustangPriMe

IS-IT--Management
Oct 9, 2002
74
GB
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top