don't save report!!

raymond3090

Registered User.
Local time
Today, 18:01
Joined
Sep 5, 2002
Messages
43
hi there, I having an extremely hard time accomplishing this, what I think should be, an extremely easy task!!

I have a report that opens in print preview when a particular command button is clicked. Some parts of the report are edited/created dynamically upon clicking this button, based on user inputs on a form (same form as cmdButton). The only problem is, when the user closes this report window, I definitely don't want to save it because it will overwrite my initial starting template. However, Access automatically pops up a "do you wish to save" box.

I know how to disable this warning, but when I do, Access chooses to save automatically. How can I disable this warning, and at the same time have Access not save the report?

This is driving me completely insane so any help would be super!:)


Regards,

-Ray
 
Ray,

Simple use the following:

DoCmd.Close acForm, "Form1", acSaveNo,

But obviously replace "Form1" with the name of your open form. Access will close the form and not save it --- just what I think you were after.

Cheers,

Andy
 
thanks for the reply Andy!

My only question then is, where do I place that line of code? The form will be open in print preview, then when they hit the close button ('X"), I want this to happen.


thanks again.
 
Ray,

Sorry, I misread your first post and thought it was a form you were having trouble with, not a report. In what way are 'parts of the report are edited/created dynamically' in such a way that Access wants to save changes? I'm working on a project at the moment that dynamically changes / produces on the fly several reports --- these are driven from within the reports themselves (in the open event, reading directly from the forms that opened them) and I can't seem to generate the same save dialogue that you appear to be getting.

Andy
 
andy:

in my form the users can basically select as many variables as they want that they want to include in the report. They do this using a multi-select list box.

So, when they click 'Develop Report' cmdbutton, I open this report in design view, add the specified labels and text boxes for the data, then open in print preview. Is this clear?

I considered doing this in the 'openreport' event of the report, but I didn't think i'd be able to edit the report in that view (I figured that 'openreport' corresponded to the report opening in print preview, not design view).

What kind of dynamic changes do you do?

-ray
 
Mine tend to be at the level of moving or hiding fields and their labels in order to generate a "user customised" report --- I haven't dynamically added or deleted fields. Have you considered including all the fields you need on the report and simply hiding or revealing them as appropriate?

Andy
 
I considered it briefly, but thought I'd be stuck with gaps where I hid the fields. Can I somehow remove these gaps? To me, it seems like to do that, I'd be editing the report again and I'd be back to where I am now!!
 

Users who are viewing this thread

Back
Top Bottom