trying to save report to specific file

goju

Registered User.
Local time
Today, 12:55
Joined
Apr 7, 2005
Messages
77
DoCmd.OutputTo acOutputReport, "MD Form",".xls" "C:\Documents and Settings\KevanAlderton.THERMOSHIELD\Desktop", True


any ideas what is wrong ??

many thanks
 
goju said:
any ideas what is wrong ??
many thanks


If we had the error msg we would probably have more of a clue :)

at first glance it looks as if you may be missing a comma

DoCmd.OutputTo acOutputReport, "MD Form",".xls", "C:\Documents and Settings\KevanAlderton.THERMOSHIELD\Desktop", True

peter
 
sorry my fault, this is the code below, it now errors on: Resume Exit_Save_Monthly_Report_Click:

error time 20

resume without error

before the error a box comes up that say "ok"

End If
DoCmd.OutputTo acOutputReport, "MD Form", "Microsoft Excel Workbook(*.xls)", "C:\Documents and Settings\KevanAlderton.THERMOSHIELD\Desktop\MD Form.xls"
Exit_Save_Monthly_Report_Click:

Err_Save_Monthly_Report_Click:
MsgBox Err.Description
Resume Exit_Save_Monthly_Report_Click:

End Sub
 
You need to have an "Exit Sub" before you error handling section or the code will run it every time
Peter

End If
DoCmd.OutputTo acOutputReport, "MD Form", "Microsoft Excel Workbook(*.xls)", "C:\Documents and Settings\KevanAlderton.THERMOSHIELD\Desktop\MD Form.xls"
Exit_Save_Monthly_Report_Click:
Exit Sub

Err_Save_Monthly_Report_Click:
MsgBox Err.Description
Resume Exit_Save_Monthly_Report_Click:

End Sub
 

Users who are viewing this thread

Back
Top Bottom