VBA & Macro Problems

Fix Access AutoExec RunCode Errors 2001 and 2425

Kushani NimanthikaKushani Nimanthika Nov 22, 2026 868 views

Question details

Identify why an AutoExec RunCode action fails after creating an ACCDE front end or opening a split database on another computer.

Fix Access AutoExec RunCode Errors 2001 and 2425
Product
Microsoft Access
Device & OS
not provided
Scenario
An Access database uses an AutoExec macro to run a VBA function at startup, including when deployed as an ACCDE front end.
Observed behavior
The startup action reports errors 2001 or 2425 during conversion or on some user computers.
Before you start

Confirm the exact error message, the RunCode function name, and the Access version and bitness on the development and affected computers. Keep the editable ACCDB source available, because VBA code cannot be edited in an ACCDE.

Solution 1Recommended

Check VBA references and test the startup function

Use the editable ACCDB to find missing dependencies, compilation errors, or a startup function Access cannot run.

1
Open the VBA editor

Open the source ACCDB in Access and press Alt+F11. If the startup macro prevents access, hold Shift while opening the database, provided the bypass key is enabled.

2
Check references

In the Visual Basic Editor, select Tools > References and look for entries marked MISSING. Restore the required library or select an appropriate available reference, then click OK.

3
Compile the project

Select Debug > Compile in the VBA editor and resolve any reported errors. Repeat until the project compiles successfully.

4
Inspect the RunCode action

In the Access Navigation Pane, right-click the AutoExec macro and choose Design View. Check that the RunCode expression names a public function in a standard module and supplies any required arguments.

5
Test the function directly

In the VBA editor, press Ctrl+G to open the Immediate window. For a function that takes no required arguments, enter ?GetUserInfo() or the actual function name and press Enter; investigate any error or unexpected result.

Check VBA references and test the startup function
Interpret the errors together: Error 2425 can indicate that Access cannot recognize a name in an expression. Error 2001 may be a consequence of the action being canceled, so investigate the first specific error and the RunCode expression.
Free Microsoft Office alternative

Use WPS Office for compatible document and spreadsheet work

WPS Office is a free, lightweight Office alternative with a familiar interface for working with documents, spreadsheets, and presentations. It supports common Microsoft Office formats for an easier move between applications. It does not fix Access AutoExec errors or replace an ACCDB or ACCDE database.

Work with tabular data in WPS Spreadsheet when a database is not requiredOpen and edit common Microsoft Office formats, including DOCX, XLSX, and PPTXUse a familiar interface for documents, spreadsheets, and presentationsMove compatible Office files between applications without changing your usual file formats
microsoft office alternative - wps office

Frequently Asked Questions

Why does Access say it cannot find my RunCode function?

Open the AutoExec macro in Design View and check the function name and arguments in the RunCode action. The function should be public and located in a standard VBA module. Also check Tools > References in the VBA editor for missing libraries.

How can I test GetUserInfo without running AutoExec?

In the editable ACCDB, press Alt+F11 and then Ctrl+G. Enter ?GetUserInfo() in the Immediate window and press Enter if the function has no required arguments. Any error or unexpected result can help identify the cause.

Why does the ACCDE work on one computer but not another?

Compare Access versions and bitness under File > Account > About Access. Also check trusted locations, required libraries, linked-table paths, and the affected user's access to resources used by the startup function.

Can I fix the VBA code directly in an ACCDE?

No. Open the editable ACCDB source, fix and compile the VBA project, and then select Database Tools > Make ACCDE to create a new deployment file.

Should I enable all macros to fix the startup error?

Not necessarily. First check the security warning and File > Options > Trust Center > Trust Center Settings > Trusted Locations. Trust or enable content only when you trust the source and your organization's policy permits it.