Microsoft Access
Access reports slow to open or print: causes and fixes
Invoices, price lists or monthly summaries that take minutes to open or print? Here is where the time goes and what Microsoft suggests.
In short
- A report takes its data from its record source, a table or a query: if the query is slow, the report is slow too.
- According to Microsoft, indexes on the fields used to search, sort and join tables are one of the best ways to improve performance.
- For values taken from other tables, Microsoft says it is more efficient to base the report on a query that includes both tables.
- Compact and Repair, turning off Name AutoCorrect and the Performance Analyzer are already built into Access.
- If only printing is slow, try a PDF: if it is ready straight away, the report is fine and the time is lost between the computer and the printer.
Why a report becomes slow
A report does not store data: it takes it from its record source, a table or a query that, as Microsoft explains, must contain all the rows and columns to be shown. When you open Print Preview or print, Access reads that data, runs the calculations, lays out the pages and only then sends them to the printer.
- 1Record sourcethe table or query, with its indexes
- 2Calculationsformulas, totals and subreports
- 3Page layoutthe Print Preview pages
- 4Printingon paper or to PDF
Microsoft presents its performance tips precisely as a way to speed up operations such as running reports based on complex queries. It also warns that a file filling up with the remains of temporary and deleted objects slows down: objects may open more slowly and queries take longer than normal. That is why a report that was fast in its first year can become slow over time, even if nobody has changed it.
First of all: find out where the time goes
Before changing settings, it is worth isolating the slow step. These checks are not a Microsoft procedure: they are the method we use so as not to change things blindly.
Work on a copy
Copy the database, or the front end if it is split, to another folder with the date in its name. All tests are done on the copy.
Open the source query on its own
Open the report in Design View: in the Property Sheet, under Record Source, you find the table or query it takes its data from. Open it in Datasheet View: if it is slow too, the problem lies in the query or the data.
Compare with Print Preview
If the query opens in a moment but Print Preview stays slow, the time is lost inside the report: calculations, subreports, the page total.
Compare paper and PDF
If Print Preview is fast but printing is not, save the report as a PDF: if the file is ready straight away, the report is fine and the time is lost between the computer and the printer.
Try another computer
If the report is slow only on one computer, or only when the database is on the network, the cause lies with that computer or the network rather than the report.
1. The source query and indexes
According to Microsoft, creating indexes for commonly used fields is one of the best ways to improve the performance of a database, more than any other tip in its guide. An index works like the one in a book: Access finds the records without scanning the whole table.
For a report, what matters most are the fields you search or filter on (the invoice date, the month, the customer), the fields you sort on and the fields that join two tables in the query.
Open the table in Design View
In the Navigation Pane, right-click the table and choose Design View.
Choose the field
Click the field name and, at the bottom, on the General tab of the field properties, find the Indexed property.
Create the index
Choose Yes (Duplicates OK), which suits dates, customers and codes that repeat, then save the table.
Try the report again
Open the query and Print Preview on the copy again and compare the times with the previous ones.
- The primary key of a table already has an index, created automatically by Access.
- On a field with many identical values, Microsoft warns that the index might not significantly speed up queries.
- Indexes slow down adding and changing data, because Access updates them for every record: do not index every field just in case.
Another frequent cause is report text boxes that look up, count or add up values in another table with so-called domain aggregate functions. Microsoft says it is more efficient to create a query that contains the fields you need from both tables and to base the report on that query.
If the database is split and the tables sit in a network folder, every slow read weighs more. The specific causes and fixes are in the guide on Access slow on a network.
2. Inside the report: calculations, subreports and pages
An older article, written for Access 2007 and kept in Microsoft's documentation archive, gives specific tips for reports. The article itself warns that not all of them apply in every case and that they should be tested on your own database:
- No domain aggregate functions in the record source of the report: according to the article they can have a significant impact on how long the report takes to open and display pages.
- Indexes on the fields used for sorting and grouping and on the fields that link a subreport to the main report.
- Fewer subreports: if a subreport uses the same query as the main report, or a very similar one, consider removing it and placing its data in the main report.
- Fewer controls and images: loading controls is the heaviest part of opening a report, and images take more time to load than other controls.
Then there is the «Page 1 of 40» text in the page footer. Microsoft does not list it among the causes of slowness, but it is a matter of logic: to print the total, Access must know how many pages there are, so it has to lay out the whole report before showing you the first page. If the total is not needed, try keeping only the page number on a copy and compare the times.
Always make changes to the report on a copy. If the report contains code or is tied to other forms and macros, it is better for someone who knows the application to make them, checking that totals and amounts stay exactly the same.
3. File maintenance and the Performance Analyzer
- Compact and Repair removes the space left by temporary and deleted objects. Make a copy first, because Microsoft warns that the repair may truncate data in damaged tables, and have everyone close the database: exclusive access is required. The command is in File › Info › Compact & Repair Database.
- Compact on Close, in File › Options › Current Database, does it automatically. Microsoft warns, however, that in databases used by several people you might not want to turn it on, because it can momentarily make the database unavailable.
- Name AutoCorrect keeps queries and reports working when a table is renamed, but slows the database down a little. If the design no longer changes, it can be turned off in File › Options › Current Database, by clearing the check boxes under Name AutoCorrect Options.
Access also has a tool that examines the structure and the data and proposes improvements: the Performance Analyzer.
Start the analysis
On the copy of the database, choose Database Tools › Analyze › Performance Analyzer.
Choose the objects
On the tabs for each object type, select the slow report, its query and the tables it uses, or open All Object Types and choose Select All. Then click OK.
Read the results
Access groups them into Recommendation, Suggestion and Idea. When you click an item, the explanation appears in the notes below the list.
Apply the useful ones
Access applies recommendations and suggestions by itself with Optimize, but suggestions come with tradeoffs to read first. Ideas must be carried out by hand, following the notes.
The Analyzer gives no suggestions about Access itself or the computer it runs on: if the time is lost on the network or on the way to the printer, it does not see it.
4. When only printing is slow
If Print Preview opens quickly but printing on paper does not, the report has already done its job. Microsoft provides two tools that help to confirm this and to work around the problem:
- PDF or XPS: on the Print Preview tab, in the Data group, the report is saved as a file to send by e-mail or print later.
- Only the pages you need: in the Print dialog box, under Print Range, choose Pages and enter the first and last page.
If the PDF is ready straight away and paper is not, the time is lost between the computer and the printer: driver, network printer, print queue. Microsoft's Access pages do not cover this case; in general it helps to try another printer and have whoever looks after the office computers check the driver.
On the computer itself, Microsoft points out that closing programs you are not using leaves more memory for Access, and that more RAM helps large queries run faster.
Would you like an opinion on your case?
Send us the file: within 48 hours you receive a free written assessment, even if the answer is that a small fix is enough.
When it is no longer enough
If the report stays slow even with the right indexes, a tidied-up query and a compacted file, the reason is often the amount of data: years of invoices and transactions in a single file, sometimes close to the Access size limit.
The tables can move to SQL Server while keeping Access, with its forms and reports: we explain how in the guide from Access to SQL Server. If the reports are also needed at other sites or outside the office, consider a web application, where summaries and documents open in the browser: here is how we bring Access to the web.
To get an idea of the size of the job, the free database check counts the tables, queries, reports, macros and modules in your file, without it leaving your computer.
Frequently asked questions
Why was the report fast and is now slow?
Usually the data and the file have grown. Microsoft explains that the remains of temporary and deleted objects make objects open more slowly: make a copy, compact the file and check the indexes on the fields used for filtering.
Can the Performance Analyzer change the database?
Yes: it applies recommendations and suggestions by itself with Optimize, and suggestions involve tradeoffs to weigh. That is why it is best run on a copy of the file, testing the report before using that copy.
Is it worth indexing every field?
No. Microsoft warns that indexes slow down adding and changing data and that they help little on fields with many identical values. Index the fields used to search, sort and join tables.
Is a more powerful computer enough?
It can help: Microsoft says more RAM speeds up large queries. But according to Microsoft, indexes improve performance more than any other tip, so it is best to start with queries and indexes.
Is Compact on Close fine if many people use the database?
Microsoft warns that with several users you might not want to turn it on, because it can make the database momentarily unavailable. Compact by hand instead, when nobody is using it and after a copy.
Sources
- Microsoft: Help Access run faster
- Microsoft: Create and use an index to improve performance
- Microsoft: Use the Performance Analyzer to optimize an Access database
- Microsoft: Compact and repair a database
- Microsoft: Introduction to reports in Access
- Microsoft: setting print options in Access
- Microsoft Learn: Application.DLookup method (Access)
- Microsoft Learn: Performance Tips To Speed Up Your Access 2007 Database (archive)
Official Microsoft pages.