> ## Content Index
> Fetch the complete content index at: https://nolongerset.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Previewing Reports
- URL: https://nolongerset.com/previewing-reports/
- Published: 2021-03-12T03:09:54.000Z
- Updated: 2026-05-08T13:05:58.000Z
- Description: That sound of your printer warming up means you forgot the acViewPreview flag again. You're better off avoiding DoCmd.OpenReport entirely.
- Author: Mike Wolfe
- Tags: Reports, #Import 2026-05-20 02:59

There are several [things that annoy me](https://nolongerset.com/report-annoyances/) about the default behavior of **DoCmd.OpenReport**. To address these annoyances, I built a replacement function that I named **PreviewReport()**. 

In this series of articles, I will take you through the evolution of this function as I address each of my frustrations.

## Part 1: Auto-Print

The default behavior of **DoCmd.OpenReport** in Access is to send the report directly to the user's default printer. In most cases, though, I prefer to preview the report on-screen first. 

I can't tell you how many times as a young developer I called that method and forgot to pass the **acViewPreview** flag. 

I would click the button on my form to preview the report. Nothing would appear on the screen. After several seconds I would get curious. *This report isn't based on a complex query*, I would think; *it should be open by now*. Another second or two and the whirring of the fan on the laser printer would alert me to my mistake. I would quick run over to pull out the paper tray before all 50 pages of the report came shooting out.

This default behavior bit me so many times at the beginning of my Access development career that I finally gave up trying to remember to include the **acViewPreview** flag altogether. Instead, I wrapped the **DoCmd.OpenReport** method inside a convenience function that I called **PreviewReport()**.

### The Code

```vba
Function PreviewReport(RptName As String, Optional Where As String = "")
    DoCmd.OpenReport RptName, acViewPreview, , Where
End Function
```

The humble beginnings of the PreviewReport function

This was just the starting point of my **PreviewReport** function. The function would go through several more iterations before arriving at its present-day form. Check back tomorrow for the next step on the journey.

*Image by [David Dunmore](https://pixabay.com/users/daviddunmore0-1279282/?utm%5Fsource=link-attribution&utm%5Fmedium=referral&utm%5Fcampaign=image&utm%5Fcontent=879360) from [Pixabay](https://pixabay.com/?utm%5Fsource=link-attribution&utm%5Fmedium=referral&utm%5Fcampaign=image&utm%5Fcontent=879360)*