Fix #Name? Date Parameters in Microsoft Access PDF Reports
Question details
Prevent parameter dates or calculated values from showing #Name? when an Access report is exported to PDF.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- A report uses values from a parameter form, and a VBA procedure opens the report and closes the form before exporting the report to PDF.
- Observed behavior
- The exported PDF may show #Name? where parameter dates or calculated values should appear.
Identify the form and controls referenced by the report, and locate the VBA procedure that opens the report and closes the form. Confirm the report name and choose a writable location for the PDF.
Keep the Parameter Form Open Until the PDF Export Finishes
Use this approach when the report refers to controls on a form that closes before the report finishes rendering.
A hidden form remains open, so report expressions can still refer to its controls. If the report stays open after export, keep the form open until the report is closed.
Open the parameter form in Design View, select the button that runs the report, and open its On Click event in the VBA editor.
Replace the premature form-closing command with Me.Visible = False in the form's button procedure. Leave the form open while the report is processed.
Use DoCmd.OpenReport "ReportName", acViewPreview, followed by DoCmd.OutputTo acOutputReport, "ReportName", acFormatPDF, "C:\Reports\Report.pdf". Replace the report name and output path with your own.
After OutputTo completes, close the report with DoCmd.Close acReport, "ReportName", then close the parameter form. If users need to keep viewing the report, leave the hidden form open until they close the report.
Open the exported PDF and verify that the dates and calculated values appear. If they do not, check the report expressions and referenced form control names in Design View.

Work With Documents and PDFs in WPS Office
WPS Office is a free, lightweight alternative with a familiar interface for working with Office documents and PDFs. Its format compatibility helps you move existing files into your workflow, although it does not fix Microsoft Access report or VBA errors.

Frequently Asked Questions
Why does my Access report show #Name? in the exported PDF?
One possible cause is that a report expression refers to a control on a parameter form that was closed before rendering finished. Keep the form open during export and check the expression and control names in report Design View.
Can I hide the parameter form while the report is exported?
Yes. In the form's VBA procedure, use Me.Visible = False instead of closing the form before opening and exporting the report.
When can I close the parameter form?
Close it after the PDF export finishes and the report no longer needs its values. If the report remains open for preview, keep the form open until the report is closed.
Can WPS Office fix the Access report error?
No. Fix the form references or export procedure in Microsoft Access. You can then open the exported PDF in WPS Office to review it.




