close report unsaved

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

Guest

Hi all,

I use a report, which i have to open first in design-modus in order to
change print-parameters (No. of columns, space between columns, etc.). I do
not close this report (as I do not want to save those changes) but do open it
at once (docmd.openreport). all that works fine. If I click for closing the
report, I get the prompt "do you want to save changes". I do not want to save
the changes and more, i don't even want to be asked at all but want to close
without saving. Is there any command to put in the Report_Close event
procedure, to prevent that and have the report closed unsaved.

Thanks hopefully and in anticipation

ulrich
 
It is possible to close the report programmatically without a prompt like
this:
DoCmd.Close acReport, "Report1", acSaveNo

But that won't do you much good if the user clicks the X at the right of the
report's title bar.

The real issue is why the design change is needed. We generally try to avoid
that, it bloats the database, contributes to concurrency issues, and blocks
the possibility of every using an MDE.

Could the parameters be entered another way, e.g. via a form as in this
example:
Limiting a Report to a Date Range
at:
http://allenbrowne.com/casu-08.html

Could you hide/show the appropriate fields, assign the recordset, or even
reassign the grouping levels in the report's Open event, as in this example:
Sorting Records in a Report at run-time
at:
http://allenbrowne.com/ser-33.html

At worst, could you base the report on a saved query, and reassign the SQL
property of the QueryDef before you OpenReport?
 
Hi, Allen
thanks a lot for trying. Maybe I'm misunderstood. I am German and I'm not
too familiar with all these pc-related expressions

1. The DoCmd.Close acReport, "Report1", acSaveNo does not work, if you are
closing from "Report1"
2. I would much prefer not to change the design. But it is no question of
filtering data but to change the way, the report should be printed. E. g. I
do change the format from normal to landscape, and/or Left- /Top-Margins,
Columns, ColumnSpacing or RowSpacing. The fact ist, that I have a given from
(i. e. labels) in various sizes. As they are all on standard-size paper the
number of labels in horizontal direction varies.
The sizes of the controls can be changed easily without opening in design,
but using the PRTMIP strings requires the opening in design modus.

If you would know a change to that, I would be delighted.

But even if not, thanks for the attempt to help.

Ulrich
 
Yes, PrtMip does require you to take the approach you chose.

I still would exepct the DoCmd.Close with acSaveNo to work if you closed the
report from a command button (not the report's own Close button.)

If someone else has a suggestion, please post it.
 
Ulrich1947 said:
1. The DoCmd.Close acReport, "Report1", acSaveNo does not work, if you are
closing from "Report1"
2. I would much prefer not to change the design. But it is no question of
filtering data but to change the way, the report should be printed. E. g. I
do change the format from normal to landscape, and/or Left- /Top-Margins,
Columns, ColumnSpacing or RowSpacing. The fact ist, that I have a given from
(i. e. labels) in various sizes. As they are all on standard-size paper the
number of labels in horizontal direction varies.
The sizes of the controls can be changed easily without opening in design,
but using the PRTMIP strings requires the opening in design modus.


If you are using PrtMIP, I think you are stuck. I haven't
tried it in years, but I remember that for some past version
of Access, you could not switch the report from design to
print view without saving the changes. The usual workaround
was the painful idea of keeping separate copies of the
report for landscape, portrait, etx.

Access 2002 introduced the Printers collection that's
supposed to allow you to specify those properties without
using design view.
 
Back
Top