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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error when using DoCmd.Close

Status
Not open for further replies.

ZappaDog

Technical User
May 13, 2002
25
US
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
 
try to save it seperatly befor u close it

Did u install it on the other computer with instaler or just copy the MDB file, Install it with the instaler can solve the problems.

 
Right now it is a .mdb as I am still developing it. The database file stays on one computer (where it works) and is being accessed via the network.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top