471,115 Members | 1,495 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,115 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 3464
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.

Similar topics

2 posts views Thread by Jonathan Goldman | last post: by
1 post views Thread by JohnM | last post: by
2 posts views Thread by Smartin | last post: by
3 posts views Thread by news.onet.pl | last post: by

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.