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

Close Report without Saving

Status
Not open for further replies.

mystuff

Programmer
Apr 30, 2004
86
US
Can a report be set up so that when a user clicks the "X" to close it, that it does not prompt him to save it. It just closes without being saved?

First I use this command:

DoCmd.OpenReport "rptFlexible", acViewDesign

Then, using VB, I populate a lot of the report based on selection criteria from a form. Then, I issue this command

DoCmd.OpenReport "rptFlexible", acViewPreview

However, when the user clicks the X to close it, they are prompted to save it. I don't want it to prompt them to save it. I just want to close it without saving.

I tried to put code in the Close Event of the report, but the prompt comes up before the code is executed. In the code that opens the preview, I have tried

DoCmd.SetWarnings False
and
DoCmd.Echo False

but it still prompts them. Any ideas?
 
I put DoCmd.SetWarnings False in the onOpen event of the report, but I was still prompted to save the report when I closed it.

Any other ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top