PDA

View Full Version : Solved: Autoexec report not running - runtime error



ntupper
03-03-2010, 03:49 AM
Hi, I have recently cut over a database from an old PC to a new one. I have a report that is run from an Autoexec via a scheduled task on the PC. The problem is I have copied all of the settings, file paths etc.etc. and now when I run the autoexec from the new PC I get "Run-time error '3615': Type mismatch in expression. When I debug it shows the following as the error ; DoCmd.OutputTo acOutputReport, stDocName, acFormatTXT, "C:\Documents and Settings\ntupper\Daily Database Maintenance Report.txt". The full code for the function is below.Function SendReport()
Dim stDocName As String 'declares the document name as the variable.
stDocName = "Daily Database Maintenance Report"
'specifies the document name.
DoCmd.OutputTo acOutputReport, stDocName, acFormatTXT, "C:\Documents and Settings\ntupper\Daily Database Maintenance Report.txt"
'Commands the output of the specified document to Text format and the location to save it to.
End Function

CreganTur
03-03-2010, 06:06 AM
Have you checked to make sure you can manually open the report?

ntupper
03-03-2010, 06:26 AM
CreganTur,

I hadn't, and it doesn't! Completely different issue than I thought but now I have something to work with. Thanks!:bow: Sometimes I am blinded by the blindingly obvious!!!!

ntupper
03-03-2010, 08:38 AM
As an update, I omitted to mention in the previous threads that I had also just upgraded from 2003 to 2007.A query in the 2003 DB would not work in 2007. I deleted the query and the report and added new (allbeit the same query and report) and everything now works fine. The underlying issue it appears was incompatibilty between the two versions.

efz
03-03-2010, 02:45 PM
intereting thanks !