473,383 Members | 1,801 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

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.Close acReport, me.Name, acSaveNo" on the close event does not
work

TIA

Phil
Nov 13 '05 #1
3 3891
"Phil Stanton" <di********@stantonfamily.co.uk> wrote in message
news:41*********************@mercury.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.Close 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.Close 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********@stantonfamily.co.uk> wrote in message
news:41*********************@mercury.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.Close 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********@stantonfamily.co.uk> wrote in message
news:41*********************@mercury.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.Close 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.Close 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
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...
1
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...
0
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...
5
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...
16
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
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....
3
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...
1
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...
6
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.