Get Run-time error 29068 whith DoCmd.Save acReport

  • Thread starter GandaSalada via AccessMonster.com
  • Start date
G

GandaSalada via AccessMonster.com

Hi,

My code change the properties o a report and I want to save the report after
that.
Here is the code:

DoCmd.OpenReport "ReportName", acViewDesign, , , acHidden
Reports!ReportName.RecordSource = "TableSource"
Reports!ReportName!lblTitle.Caption = strTitle
Reports!ReportName.Caption = strName
DoCmd.Save acReport, "ReportName"
DoCmd.OpenReport "ReportName", acViewPreview

Most of the time I get the Run-time error 29068. Sometimes I don't!
It seems that after I open and close manualy the report, the error disapear.
The report is saved even if I get the error.
I don't understand.

Any help?
 
G

Guest

When you Save the report, does that close it also? Maybe you also need to
explicitly close it. That's my only guess.
 
G

GandaSalada via AccessMonster.com

Jim said:
When you Save the report, does that close it also? Maybe you also need to
explicitly close it. That's my only guess.
[quoted text clipped - 15 lines]
Any help?

No, It doesn't close it
I already tried to close the reports after saving. does the same.
I tried now to close and save it at the same time:
DoCmd.Close acReport, "ReportName", acSaveYes
It seems to works.
Thank you for the guess.
 

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

Top