By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,480 Members | 755 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,480 IT Pros & Developers. It's quick & easy.

Docmd.OpenReport - slow opening a report.

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.