I have a function which copies a report to a temp. version, makes changes and then opens for printing. It works fine on "Home" computer, but from any other I get "Run-time Error '40070' Method 'Close' of object '|DoCmd' failed".
It works if I change to acSaveNo, but that defeats the purpose???
Function PrintForms(frm As Form)
strRpt = "rpt_Rev"
EditReport strRpt, CurrentDb
GetRevisions frm, rpt
DoCmd.Close acReport, rpt.Name, acSaveYes (ERROR HERE)
CreateFormQueries
EditReport strFormType, CurrentDb
Set rpt = Reports(strRptName)
FormatFormsReport rpt
DoCmd.Close acReport, strRptName, acSaveYes
DoCmd.OpenReport strRptName, acViewPreview
Set rpt = Nothing
End Function
It works if I change to acSaveNo, but that defeats the purpose???
Function PrintForms(frm As Form)
strRpt = "rpt_Rev"
EditReport strRpt, CurrentDb
GetRevisions frm, rpt
DoCmd.Close acReport, rpt.Name, acSaveYes (ERROR HERE)
CreateFormQueries
EditReport strFormType, CurrentDb
Set rpt = Reports(strRptName)
FormatFormsReport rpt
DoCmd.Close acReport, strRptName, acSaveYes
DoCmd.OpenReport strRptName, acViewPreview
Set rpt = Nothing
End Function