CopyObject fails when using automation

  • Thread starter pubdude2003 via AccessMonster.com
  • Start date
P

pubdude2003 via AccessMonster.com

Hey all, trying to run a report in an MDB from an MDE and it is failing with
a 2501 the CopyObject was cancelled.

Any thoughts anyone?

'Set myApp = New Access.Applic ation
'myApp.OpenCurrentDatabase ("C:\mydb\Reports.mdb")
'myApp.DoCmd.CopyObject "C:\mydb\Reports.mdb", "Report - " & ReportName,
acReport, "report1"

'myApp.OpenReport "Report - " & ReportName, acViewNormal, "", "", acHidden
'myApp.Close acReport, "Report - " & ReportName
'Pause 1000
'myApp.OpenReport "Report - " & ReportName, acViewNormal, "", "", acHidden
'myApp.Close acReport, "Report - " & ReportName
'my.app.DeleteObject acReport, "Report - " & ReportName
'myApp.CloseCurrentDatabase
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top