Others

Fix the Access 2016 VBA File Not Found Error on Forms

Rana GarciaRana Garcia Nov 25, 2026 869 views

Question details

Find the cause of a file not found error when VBA code is added to an Access form.

Fix the Access 2016 VBA File Not Found Error on Forms
Product
Microsoft Access 2016
Device & OS
not provided
Scenario
The user adds VBA code to a form and tries to run an event procedure.
Observed behavior
Access reports an On Current event error saying that a file cannot be found, even with simple code and in a new test database.
Before you start

Note the exact error message and when it appears, then open the affected database in Access. Check whether the same error occurs in a new blank database, since that can distinguish a database-specific problem from an Access or environment issue.

Solution 1Recommended

Check VBA references and compile the project

Use this first to identify missing libraries or compilation errors that may prevent form code from running.

1
Open the VBA editor

Open the database in Access and press Alt+F11 to open the Visual Basic Editor.

2
Inspect references

In the editor, select Tools > References and look for entries marked MISSING. Locate or restore the required library, or clear a missing reference only if the project does not need it.

3
Compile the code

Select Debug > Compile and address any highlighted errors. For a control on the current form, check whether a reference such as Me.DateCompleted is appropriate.

4
Test the form event

Return to Access, open the form in Design View, and check its Property Sheet > Event tab. Confirm that On Current is set to [Event Procedure] if it should run VBA, then open the form to test it.

Check VBA references and compile the project
Free Microsoft Office alternative

Use WPS Office for everyday documents and spreadsheets

WPS Office is a free, lightweight alternative for working with documents, spreadsheets, and presentations in a familiar interface. Its Office-format compatibility helps with migration, but it does not repair Access or replace an Access database and its VBA forms.

Work with spreadsheet data outside Access in WPS SpreadsheetsOpen and edit common Microsoft Office formats, including DOCX, XLSX, and PPTXUse a familiar interface for documents, spreadsheets, and presentationsGet started with a free, lightweight office suite
QA img-9

Frequently Asked Questions

Why does the error occur even with simple form code?

Simple code can still fail if a VBA reference, the project, or the Access installation has a problem. In the VBA editor, check Tools > References and select Debug > Compile; also test a new blank database.

What should I do if a reference is marked MISSING?

In the VBA editor, open Tools > References. Restore or locate the required library, or clear the reference only if the project does not use it, then select Debug > Compile.

Does an error in a new database mean the original project is corrupt?

Not necessarily. If a new blank database also fails, the issue may involve Access, a library, or the environment. On Windows, consider repairing Office through Control Panel > Programs and Features.

Can I import a form into a new database without bringing over its VBA code?

A form import can include its associated code. Use External Data > New Data Source > From Database > Access to import objects selectively, and test each imported form. Rebuild a form or its code if it reintroduces the error.

Can WPS Office fix an Access VBA project?

No. Use Microsoft Access to inspect references, compile VBA, and repair or migrate the database. WPS Office can instead be used for compatible documents and spreadsheets.