How to Automatically Use an Invoice Number as a PDF File Name in MS Access
Question details
The user needs the automatically generated invoice number from a Microsoft Access application to populate as the default file name in the Save As dialog when generating a PDF.

- Product
- Microsoft Access / Adobe Acrobat
- Device & OS
- Windows
- Scenario
- Exporting or printing database invoices to PDF format.
- Observed behavior
- The Acrobat Save As dialog opens with a default or blank file name instead of recognizing the dynamically generated invoice number from the application.
Ensure you have the appropriate permissions to modify the VBA code or export routines in your Microsoft Access application if you intend to fully automate the file naming process.
Manually Enter the Invoice Number using Adobe PDF Printer
Use the 'Print to PDF' feature to generate the file and manually input the generated invoice number during the save process.
In your Microsoft Access invoice application, navigate to the invoice you want to save and click the Print button.
From the printer dropdown list, select 'Adobe PDF' or your preferred virtual PDF printer.
Click 'Print' or 'OK' to proceed with document generation.
When the 'Save As' dialog box appears, manually type the generated invoice number into the File Name field and click 'Save'.

Automate PDF Naming via Access VBA Export Routine
Configure the Microsoft Access VBA code to automatically pass the invoice number variable directly to the PDF output filename, bypassing the Save As dialog entirely.
Manage Your Documents and PDFs Seamlessly with WPS Office
While Microsoft Access is used for database applications, you can use WPS Office as a free, lightweight, and highly compatible alternative for managing your daily spreadsheets, documents, and PDF files. WPS Office provides built-in PDF export and editing tools that make document conversion effortless.

Frequently Asked Questions
Why doesn't the Adobe PDF printer automatically pick up the Access record name?
The virtual PDF printer receives a flattened print stream from Windows, which does not pass specific database field variables (like invoice numbers) from Access to the Save As dialog by default.
Can I automate PDF creation without using Adobe Acrobat?
Yes. Microsoft Access has a built-in 'Export to PDF' feature accessible via VBA (using the DoCmd.OutputTo method) that handles PDF creation natively without requiring third-party virtual printers.
How can I bulk export multiple invoices to PDF with their respective numbers?
You need to write a VBA loop in Access that iterates through your recordset. For each record, the code must apply the unique invoice number to the output filename variable and execute the OutputTo command.




