473,563 Members | 2,703 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Prevent saving a report

In code I am opening a report in deign view, adding code to the report to
output it to Word in an editable form. I then want t close the report but
not save the changes.
Is there any way or preventing the option to save changes from being
displayed (the answer is always no)

The "DoCmd.Clos e acReport, me.Name, acSaveNo" on the close event does not
work

TIA

Phil
Nov 13 '05 #1
3 3909
"Phil Stanton" <di********@sta ntonfamily.co.u k> wrote in message
news:41******** *************@m ercury.nildram. net...
In code I am opening a report in deign view, adding code to the report to
output it to Word in an editable form. I then want t close the report but
not save the changes.
Is there any way or preventing the option to save changes from being
displayed (the answer is always no)

The "DoCmd.Clos e acReport, me.Name, acSaveNo" on the close event does not
work

TIA

Phil


Put
DoCmd.Close acReport, ReportName, acSaveNo
in your code, not in On Close of the report.

Bruno
Nov 13 '05 #2
Thanks Bruno but I cant see how that will work,
I have a number of reports which theoretically I can output as word
documents. I have a form with a list box that shows the reports. On pressing
the print button on the form, it adds code to the OnPrint sections of the
selectede report to initiate the output to Word routines. In order to output
the whole report to Word, the user has to go to the next page until they
reach the end. At that point I want to close the report. All the running
code is initiated by the printing process of the report. How can I detect
the end of the report and pass back control to the form that initiated the
proccess to do the The "DoCmd.Clos e acReport, me.Name, acSaveNo" on the
close event bit

Thanks

Phil

"Bruno Campanini" <br************ ****@tin.it> wrote in message
news:G6******** **************@ news4.tin.it...
"Phil Stanton" <di********@sta ntonfamily.co.u k> wrote in message
news:41******** *************@m ercury.nildram. net...
In code I am opening a report in deign view, adding code to the report to
output it to Word in an editable form. I then want t close the report but
not save the changes.
Is there any way or preventing the option to save changes from being
displayed (the answer is always no)

The "DoCmd.Clos e acReport, me.Name, acSaveNo" on the close event does
not work

TIA

Phil


Put
DoCmd.Close acReport, ReportName, acSaveNo
in your code, not in On Close of the report.

Bruno

Nov 13 '05 #3
"Phil Stanton" <di********@sta ntonfamily.co.u k> wrote in message
news:41******** *************@m ercury.nildram. net...
Thanks Bruno but I cant see how that will work,
I have a number of reports which theoretically I can output as word
documents. I have a form with a list box that shows the reports. On
pressing the print button on the form, it adds code to the OnPrint
sections of the selectede report to initiate the output to Word routines.
In order to output the whole report to Word, the user has to go to the
next page until they reach the end.
I.e. in preview mode the user presses PagDown?
At that point I want to close the report. All the running code is
initiated by the printing process of the report. How can I detect the end
of the report and pass back control to the form that initiated the
proccess to do the The "DoCmd.Clos e acReport, me.Name, acSaveNo" on the
close event bit


I'm not sure to understand ok.
In any case if you are in the Form, you can't send
"DoCmd.Clos e acReport, me.Name, acSaveNo"
because Me.Name means, in the circumnstance,
the Form's Name.
Replace Me.Name with "ReportXXX" or a variable
containing the Report's Name.

In order to allow the Report's operations to
complete try adding DoEvents in your Form's
print button:

..............
..............
DoEvents
DoCmd.Close acReport, "ReportXXX" , acSaveNo

Ciao
Bruno
Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1336
by: Bob Murdoch | last post by:
We have an asp application that creates reports from a database. The managers would like to create the report, view the results, add a comment, and save the report so that he can send a link to the employee that the report pertains to. The building of the report is a lengthy process. We would like to be able to save the resulting html...
1
1318
by: Kirsty Ryder | last post by:
Hi, I'm not sure whether I'm being silly and its really obvious, or whether I'm being over-ambitious. At the end of each month I run a report. A pop up dialog box prompts for the dates and station ground I want to run the report for. I then publish the report to Word and then save it in a shared folder. I do this for each station...
0
1420
by: soberhi | last post by:
I am new to Access (and Access programming) so kindly be gentle. I did try to search around before asking this question. I am simplifying my problem in the hopes that this scaled down version will mirror my current situation. Scenario: I have 5 clients in my customer table. My goal:
5
2194
by: Tom | last post by:
I have a subreport that can contain one or two pictures per page. The subreport is similar to an appendix to the main report. The recordsource contains a field "IncludeInReport" (Yes/No) for each picture record. What code do I use and where does it go to prevent printing the subreport if there are no picture records marked "Yes" in the...
16
6249
by: MLH | last post by:
If I give someone a runtime app, they can open the database window by pressing the F-11 key. How to prevent???
5
9984
by: Vincent | last post by:
I have a bound listbox control on one of my forms that has an associated afterupdate event. When this event is invoked, I lock the control to prevent the user from clicking on it more than once. However, it appears that Access is queuing the mouse clicks and calling the afterupdate event regardless of whether the control is locked or not. ...
3
2193
by: RobEveryThingIsPossible | last post by:
IN VISTA MS Access 2000 Printer Settings Not Saving With Vista Bus. The printer settings (Label or Env.) keep on change back to another setting after saving them on a report or form, when viewing them on other Vista computers. I have tried many things see Example: Open my report in Design mode. Select Page Setup. On the Page tab,...
1
5776
by: MSwanston | last post by:
Hi I need some help with saving retreiving data from the cache, and how best to structure my code. FYI am working in VS2005/under .NET2 Framework. Ok, we have a series of reports that get run via a report filter screen, and whilst each report is being generated, it populates a memorystream/streamwriter. This has always been done this way but...
6
8056
by: Eddie | last post by:
Hi all, I am displaying a number of reports, and giving the users an option to display them on the web or download them to Excel. If they want the Excel file, I just use the PHP header command to change the Content- Type and Content-Disposition headers, and essentially print the same report, and it's done. That works fine. But in some...
0
7659
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7882
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8103
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7634
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7945
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5481
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3634
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3618
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2079
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.