How to Print a Delivery Note for the Current Record in Access
Question details
The user needs to print a delivery note for only the currently viewed form record instead of the entire database.

- 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 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.
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.
Right-click your form in the navigation pane and select Design view, then click to select your Print command button.
Open the Property Sheet, navigate to the Event tab, and select [Event Procedure] from the drop-down menu for the On Click event.
Click the builder button (...) next to the On Click property to open the Visual Basic Editor.
Enter the command to open the report with a WHERE condition matching the current ID. Example: DoCmd.OpenReport "rptNote", acViewNormal, , "OrderID=" & Me.OrderID
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.

Filter the Report Using an Access Macro
Use the WHERE parameter within the Macro Builder to apply a filter without writing any VBA code.
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.

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.




