472,989 Members | 2,930 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Docmd.OpenReport - slow opening a report.

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 following codes are written in the VB Applcation.
- Prior to opening the report, I set its recordsource with a sql:
..Reports!rptABC.RecordSource = sSql. The sSql searches for a specific
LastName: "Select * from tblABC where LastName >= "Smith" and LastName <=
"Smith".
- Table "tblABC" which the report is based on has 2655 records.
- Then I issue the DoCmd.OpenReport command.
- The problem is that it takes a long long time ( ie 5 minutes ) for the
report to come up in preview mode.

Can somebody please tell me what I need to do to improve the situation? Is
there a problem with Access's DoCmd.OpenReport command? Is there another
way to open up the report in preview mode?
Any help is much appreciated.

Andrew
Nov 12 '05 #1
1 3779
Andrew wrote:
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 following codes are written in the VB Applcation.
- Prior to opening the report, I set its recordsource with a sql:
.Reports!rptABC.RecordSource = sSql. The sSql searches for a specific
LastName: "Select * from tblABC where LastName >= "Smith" and LastName <=
"Smith".
- Table "tblABC" which the report is based on has 2655 records.
- Then I issue the DoCmd.OpenReport command.
- The problem is that it takes a long long time ( ie 5 minutes ) for the
report to come up in preview mode.

Can somebody please tell me what I need to do to improve the situation? Is
there a problem with Access's DoCmd.OpenReport command? Is there another
way to open up the report in preview mode?

Any help is much appreciated.

Andrew


Why don't you set the recordsource in the OnOpen event of the report.
strSQL = "Select * From Table1...."
Me.Recordsource = strSQL

If you are looking for smith, why not do this
Docmd.OpenReport "YourReportName",acViewPreview,,"LastName = 'Smith'"

5 minutes to display is about 4 minutes, 59 seconds too much

Nov 12 '05 #2

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

Similar topics

2
by: Jonathan Goldman | last post by:
Hi- I have a relatively simple report that I open in an Access '97 VBA procedure, using the Docmd.OpenReport "rptName", acViewNormal syntax. The problem is that doing this usually crashes...
1
by: Filips Benoit | last post by:
Dear All, DoCmd.OpenReport RPT_TEST, A_PREVIEW, QueryAsFilter doesn't work correctly in A97 but works OK in A2K. Is this a bug for A97 ? Filip
3
by: Blah | last post by:
Hello, I'm trying to use the where clause in OpenReport to limit the data return on the subreport. Is there a way to do it using that method or OpenReport only work with the report you're...
1
by: JohnM | last post by:
I don't seem to be able to get opening a report and sortin the rcords right. I an open the report, limited to a range of my choosing. So, for example the code below opens my report and limits it...
2
by: Smartin | last post by:
Question about DoCmd.PrintOut in A97. I have a form on which all the controls are unbound. There is a large textbox that the user can type stuff in and a couple labels. I am trying to code a...
3
by: news.onet.pl | last post by:
Hello! I have a question concerning to open the reports. I know that DoCmd.OpenReport is a obsolete form of opening the reports, but how to implement opening reports in VB using another VB code?...
4
by: Simon | last post by:
Dear reader, The syntax for Docmd.OpenReport is: OpenReport(ReportName, View, FilterName, WhereCondition, WindowMode, OpenArgs) Example The following example prints Sales Report while...
4
by: robtyketto | last post by:
Greetings, I originally used a button on a from created via the button wizard (access 2007) to run my report which was based on a query. Since I wanted to add some validation I removed the...
4
by: gazza10001 | last post by:
Hi i hope you can help my company uses access and has modified for its needs usually what happens is you serach for the invoice by its number and then it brings all the information up such as...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...

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.