473,383 Members | 1,792 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.

How to supress message when dynamically setting Report recordsource

Hi,

I'm using MS Access 2003 and have developed a report that is called
from a form that customizes a SQL statement to produce various results.

DoCmd.OpenReport conReportName, acViewDesign

Set rpt = Reports.Item(conReportName)
With rpt
.Visible = True
.RecordSource = strSQL ' customized sql string
End With

Everything works correctly - report content always reflects the SQL
statement passed so I'm happy with that but.....

When I close the report I get prompted with the following:

"do you want to save changes to the design of report"

I've placed "DoCmd.SetWarnings False" on various events of the report
..Close, .Deactivate but realize now this prompt fires before either of
these events.

Any ideas?

Thanks

Nov 13 '05 #1
1 3081
ZRexRider wrote:
Hi,

I'm using MS Access 2003 and have developed a report that is called
from a form that customizes a SQL statement to produce various
results.

DoCmd.OpenReport conReportName, acViewDesign

Set rpt = Reports.Item(conReportName)
With rpt
.Visible = True
.RecordSource = strSQL ' customized sql string
End With

Everything works correctly - report content always reflects the SQL
statement passed so I'm happy with that but.....

When I close the report I get prompted with the following:

"do you want to save changes to the design of report"

I've placed "DoCmd.SetWarnings False" on various events of the report
.Close, .Deactivate but realize now this prompt fires before either of
these events.


There is no reason to open the Report in design view to apply a dynamic
RecordSource. Just move your code to the Open event of the report. No
design view = no save prompt.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com

Nov 13 '05 #2

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

Similar topics

1
by: Andrew | last post by:
Hi All: I am using Access2000 and I find that the command to open an Access report in preview mode is very slow: DoCmd.OpenReport rptABC, acViewPreview, "", "" The scenario is this: - The...
2
by: Xiphias | last post by:
Hi, Im trying to change the color of a text box on a report that im printing from a form. On the form I got a check box that has to tricker the color of that textbox on the printed report....
1
by: John M | last post by:
Hi, I want to set the recordsource of a report on the basis of the selection from a combo box. If the report is not yet open, I am told it is not open or not found. If it is open I'm told that...
3
by: RC | last post by:
I can't quite grasp the concept of creating custom reports depending upon what options a user picks on a Form. For example, the user clicks on a "Print Reports" button and a Form pops up. On the...
6
by: Mike Conklin | last post by:
This one really has me going. Probably something silly. I'm using dcount for a report to determine the number of different types of tests proctored in a semester. My report is based on a...
3
by: amywolfie | last post by:
Hi: I need to set the RecordSource of a single report to a different query each time the report is run. I'd like to do something in VBA like: If Me.PK_Rules = 1 Then DoCmd.OpenQuery...
1
by: pooter | last post by:
In my report called rptStockFlow i have the products underlined with red if balance is not equal to in - out: Const conNormal = 400 Const conHeavy = 900 ' exra bold Private Sub...
5
by: dana1 | last post by:
Hello Experts! Does anyone know if there is a way to set the values of query parameters from VBA for a report's recordsource? (i.e., I want to set the values of the parameters and NOT have the...
2
by: khani | last post by:
Hi i have following situation in cystal report in detail section i have a field say name.now i have five duplication record like this zahid zahid zahid zahid
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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.