troubleshooting Question

docmd.close, acsave not working

Avatar of ClaudeWalker
ClaudeWalker asked on
Microsoft Access
26 Comments1 Solution1318 ViewsLast Modified:
I am closing a modified report via VBA.  I use docmd.close, "rptYearlyWPPI_Expentiures", acsaveyes and I still get prompted to save the form and corresponding subform.

here is my code:

Thanks, JOe K.
DoCmd.OpenReport "rptYearlyWPPI_Expenditures", acViewDesign, , , acHidden
                Dim sSql As String
                If IsNull([Forms]![JobsStatsInfoForm]![MonthIndicator]) Then
                    [Reports]![rptYearlyWPPI_Expenditures]![qryWPPI_Funding subreport].Report.RecordSource = "qryWPPI_Funding_Null_sbrpt"
                    [Reports]![rptYearlyWPPI_Expenditures].RecordSource = "qryWPPI_Funding_Null"
                    [Reports]![rptYearlyWPPI_Expenditures]![qryWPPI_Funding subreport].Report.RecordSource = "qryWPPI_Funding_sbrpt"
                    [Reports]![rptYearlyWPPI_Expenditures].RecordSource = "qryWPPI_Funding"
                End If
                DoCmd.Close acReport, "rptYearlyWPPI_Expenditures", acSaveYes
                DoCmd.OpenReport "rptYearlyWPPI_Expenditures", acViewPreview
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Database Architect / Application Developer
Join our community to see this answer!
Unlock 1 Answer and 26 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 26 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros