Printing Problems

How to Print a Delivery Note for the Current Record in Access

Phi Hung VoPhi Hung Vo Nov 3, 2026 868 views

Question details

The user needs to print a delivery note for only the currently viewed form record instead of the entire database.

Print a Delivery Note for the Current Access Record
Product
Microsoft Access
Device & OS
not provided
Scenario
Clicking a command button on an Access form to trigger a print job for a specific delivery note.
Observed behavior
Without proper filtering, the command button prints delivery notes for every single order in the database.
Before you start

Before modifying your database, ensure you know the exact name of your report and the primary key field name (such as OrderID) that identifies the specific record.

Solution 1Recommended

Use a VBA Event Procedure to Filter the Report

Add VBA code to the command button's On Click event to pass a condition that restricts the printed report to the current OrderID.

This is the most precise method to ensure the report strictly follows the active record on your form. You will need to use the Visual Basic Editor to map the OrderID.

1
Open the form in Design view

Right-click your form in the navigation pane and select Design view, then click to select your Print command button.

2
Access the Event Procedure

Open the Property Sheet, navigate to the Event tab, and select [Event Procedure] from the drop-down menu for the On Click event.

3
Open the Visual Basic Editor

Click the builder button (...) next to the On Click property to open the Visual Basic Editor.

4
Insert the VBA code

Enter the command to open the report with a WHERE condition matching the current ID. Example: DoCmd.OpenReport "rptNote", acViewNormal, , "OrderID=" & Me.OrderID

5
Update field names and save

Replace 'rptNote' with your actual report name and 'OrderID' with your specific ID field, then save your changes and switch back to Access Form view to test.

Use a VBA Event Procedure to Filter the Report
For Beginners: If you are not used to working with code, make sure you paste the VBA command exactly between the existing 'Private Sub' and 'End Sub' lines generated by Access.
Free Microsoft Office alternative

Looking for a Lightweight Alternative to Microsoft Office?

While WPS Office does not feature a relational database tool like Access, it serves as a powerful, free alternative for Microsoft Word, Excel, and PowerPoint. If you frequently handle reports, spreadsheets, and document formatting, WPS Office provides everything you need in one unified, fast-loading application.

Fully compatible with Microsoft Word, Excel, and PowerPoint formats (.docx, .xlsx, .pptx).Familiar user interface ensuring a seamless transition and minimal learning curve.Lightweight application that utilizes minimal system resources.Includes a powerful built-in PDF toolkit for converting, editing, and signing documents.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my Access report print all records by default?

By default, the OpenReport action in Access pulls all records bound to the report's underlying query or table. Unless you explicitly define a WHERE condition, Access assumes you want to process the entire dataset.

What is a WHERE condition in Access macros?

A WHERE condition is a parameter that acts as a filter. It tells Access to restrict the report to only display or print records that meet specific criteria, such as a primary key matching the record actively shown on your screen.

Can I use this method to export the single record to PDF instead of printing?

Yes. If you use VBA, change the DoCmd.OpenReport action to DoCmd.OutputTo. If using a Macro, change the action to ExportWithFormatting. You can maintain the same logic to isolate the current record during export.