Disabling the prompt to change a modified report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi!

I have a report which gets dynamically created in code when a button is
pressed on a form. This is because it is based on a multi-value crosstab
query where just about everything can change!

Anyway, it all works fine, except when I close the report, I get prompted to
save changes to it's design. This I will never want to do, so how do I stop
this?

I have tried report.dirty = false, but that gives an error.

Any help greatly appreciated.

Thanks
 
Try closing the report after the design changes like this:
DoCmd.Close acReport, "Report1", acSaveYes
 
But surely that will save and close the report at that point?

I need the report on screen (and need the option to print it) until I want
to close it. Also, the report never actually needs to be saved at all. It is
created from scratch each time and then needs to be thrown away. Can I
somehow delete the report (if I save it as you suggest) from its onClose
method?

Paul
 
Yes, it will save the changes. You can then open it (in Preview or Normal),
and use it with the new settings you saved.

If you don't want it saved at all, you could then delete the report again.

Paul, I don't really understand why you are dynamically creating a report.
That will stop you from ever turning your MDB into an MDE, so I would not
use this approach. Create a generic report with enough unbound controls to
cope with whatever you could need. Then use Report_Open to dynamically
generate a SQL string to use as its RecordSource, loop through the controls
to bind them to the Fields of this source, locate and size the controls
(Left, Top, Width, Height, and Visible), apply any filters, modify the
ControlSource of each GroupLevel, and so on. Design view is not needed, and
there will be no prompt to save.
 
Back
Top