Fix the Access 2016 VBA File Not Found Error on Forms
Question details
Find the cause of a file not found error when VBA code is added to an Access form.

- 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.
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.
Check VBA references and compile the project
Use this first to identify missing libraries or compilation errors that may prevent form code from running.
Open the database in Access and press Alt+F11 to open the Visual Basic Editor.
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.
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.
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.

Test a new database and migrate valid objects
Use a new database to determine whether the problem is confined to the original VBA project.
Repair the database or Microsoft Office installation
Try database repair for an affected file, or Office repair if a new test database also fails.
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.

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.




