Access Report Prints Form Instead — Seeking Insights from the Community

Phillip Bridgeman 0 Reputation points
2025-06-12T17:57:21.6633333+00:00

Hi everyone,

I'm hoping someone here can shed light on a frustrating issue we've been facing with Microsoft Access. We have a database where users click a button on a form (labeled “Delivery Sheet”) to open a report in Print Preview mode. The report displays correctly in a new tab, but when users click the Print button in the ribbon, it prints the form instead of the report — even though the report is visibly in front.

Here's what we've tried so far:

  • The embedded macro behind the button uses OpenReport (Print Preview) followed by SelectObject to set focus on the report

We've tested adding Maximize as a macro action between OpenReport and SelectObject

The issue persists even after updating the Brother printer driver, repairing Office/Access, and verifying that other Office apps print fine

Pressing Ctrl + P from the report preview prints the correct report — every time

Selecting the specific printer manually also works

Switching to “Use Default Printer” in Page Setup works inconsistently

From what we can tell, it seems like Access still considers the form to be the active object when using the ribbon Print button, even if the report is in preview mode.

Has anyone run into this issue before?

Are there more reliable ways to ensure report focus when using macros?

Would switching to overlapping windows mode solve the issue reliably?

Is there a VBA-free workaround that works 100% of the time?

Should we just train users to always use Ctrl + P or bypass preview with direct printing?

Any insights, workarounds, or lessons learned would be appreciated. Thanks in advance!Hi everyone,

I'm hoping someone here can shed light on a frustrating issue we've been facing with Microsoft Access. We have a database where users click a button on a form (labeled “Delivery Sheet”) to open a report in Print Preview mode. The report displays correctly in a new tab, but when users click the Print button in the ribbon, it prints the form instead of the report — even though the report is visibly in front.

Here's what we've tried so far:

The embedded macro behind the button uses OpenReport (Print Preview) followed by SelectObject to set focus on the report

We've tested adding Maximize as a macro action between OpenReport and SelectObject

The issue persists even after updating the Brother printer driver, repairing Office/Access, and verifying that other Office apps print fine

Pressing Ctrl + P from the report preview prints the correct report — every time

Selecting the specific printer manually also works

Switching to “Use Default Printer” in Page Setup works inconsistently

From what we can tell, it seems like Access still considers the form to be the active object when using the ribbon Print button, even if the report is in preview mode.

Has anyone run into this issue before?

Are there more reliable ways to ensure report focus when using macros?

Would switching to overlapping windows mode solve the issue reliably?

Is there a VBA-free workaround that works 100% of the time?

Should we just train users to always use Ctrl + P or bypass preview with direct printing?

Any insights, workarounds, or lessons learned would be appreciated. Thanks in advance!

Microsoft 365 and Office | Access | Development
{count} votes

2 answers

Sort by: Most helpful
  1. George Hepworth 22,215 Reputation points Volunteer Moderator
    2025-06-25T13:17:32.18+00:00

    As a matter of fact, it's hard to know what specific issue is at work without being privy to the context where this occurs. Too many factors to account for without a hands-on review.

    I doubt many people encounter this exact problem because VBA is the preferred approach and would allow you to control the behavior you need.

    0 comments No comments

  2. Ken Sheridan 3,546 Reputation points
    2025-11-25T13:45:55.68+00:00

    You might like to take a look at InvoicePDF.zip in my Dropbox public databases folder at:

    https://www.dropbox.com/scl/fo/0scigd3r48hx5xrev2jrf/AB0-GMdTgMAO5O1cGdr3QW0?rlkey=ib6bs6g9jqcrywwzivur3265t&dl=0

    This little demo file illustrates, amongst other things how to open a report of the current record, an invoice in this case. The code for the 'Open Current Invoice' button on the invoice form is:

    On Error Goto Err_Handler

    On Error Goto Err_Handler
    Const MESSAGE_TEXT = "No current invoice."
    If Not IsNull(Me.InvoiceNumber) Then
        ' ensure current record is saved
        Me.Dirty = False
        ' open report in print preview
        DoCmd.OpenReport "rptInvoice", View:=acViewPreview
    Else
        MsgBox MESSAGE_TEXT, vbExclamation, "Invalid Operation"
    End If
    
    Exit_Here:
        Exit Sub   
    
    Err_Handler:
    MsgBox Err.Description
    Resume Exit_Here
    

    The report's RecordSource query references the primary key of the current record as a parameter:

    SELECT CanShrinkLines([Invoices].[Customer],[Invoices].[AddressLine1],[Invoices].[AddressLine2],
        [City],[CountyOrRegion],[Invoices].[PostCode],[Country]) AS CustomerAddress, 
        Invoices.InvoiceNumber, Invoices.InvoiceDate, Products.Product, InvoiceDetails.Quantity, 
        InvoiceDetails.UnitPrice, InvoiceDetails.TaxRate, [InvoiceDetails].
        [UnitPrice]*[Quantity] AS Amount
    FROM Products INNER JOIN ((Customers 
        INNER JOIN (Countries 
            INNER JOIN (CountiesOrRegions 
                INNER JOIN (Cities INNER JOIN Invoices 
    ON Cities.CityID = Invoices.CityID) 
        ON CountiesOrRegions.CountyOrRegionID = Cities.CountyOrRegionID) 
            ON Countries.CountryID = CountiesOrRegions.CountryID) 
                ON Customers.CustomerID = Invoices.CustomerID) 
        INNER JOIN InvoiceDetails 
    ON Invoices.InvoiceNumber = InvoiceDetails.InvoiceNumber) 
    WHERE Invoices.InvoiceNumber=[Forms]![frmInvoice]![InvoiceNumber];
    
    

    If you are unfamiliar with entering code into a form's, report's, report section's or control's event procedures, this is how it's done in form or report design view:

    1. Select the form, report, section or control as appropriate and open its properties sheet if it's not already open.
    2. Select the relevant event property in the Event tab, and select the 'build' button (the one on the right with an ellipsis (3 dots)).
    3. Select Code Builder in the dialogue and click OK. This step won't be necessary if you've set up Access to use event procedures by default.
    4. The VBA editor window will open at the event procedure with the first and last lines already in place. Enter or paste in the code as new line(s) between these.
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.