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
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