How to Use a Form from Another Access Database Without Copying
Question details
The user wants to utilize a form stored in an external Access database file from their main application without duplicating the form.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Developing or deploying an Access application that relies on forms located in a separate database file.
- Observed behavior
- Compiling the main application does not automatically embed the external forms; the secondary database must be handled correctly during runtime deployment.
Ensure both the main Access database and the external database (MDB or ACCDB) are saved in a trusted location and that you have the necessary permissions to open and edit them.
Set Up a Database Reference to Access External Forms
Create a reference in the VBA editor to the external database so you can call its forms and public code without duplicating them.
By setting a reference to another Access database, you can expose its public code and forms. This allows the main application to open or call forms stored in the referenced database.
However, be aware that compiling the main application into an executable format does not embed these external forms. The referenced MDB or ACCDB file must remain accessible and must be deployed alongside your main application.
Open your main Access database and press ALT + F11 to launch the Visual Basic for Applications (VBA) editor.
Navigate to 'Tools' > 'References' in the top menu bar. Click 'Browse' and change the file type filter to Microsoft Access Databases (*.mdb, *.accdb). Locate and select the external database containing your form.
In the external database, create a standard VBA module with a public function (e.g., Public Function OpenMyForm()) that opens the target form using DoCmd.OpenForm.
In your main database's VBA code, simply call the public function you created in the external database to trigger the form to open.

Import the Forms Directly into the Main Database
If deploying two separate files is problematic, the most reliable approach is to copy or import the required forms into the main database.
Looking for a Lightweight Office Suite? Try WPS Office
While Microsoft Access handles specialized database management, WPS Office is the perfect alternative for your everyday documents, spreadsheets, and presentations. It offers full compatibility with Microsoft Office formats in a lightweight, user-friendly, and highly efficient package.
- 1. Download the Installer: Visit the official WPS Office website and click the free download button.
- 2. Install the Suite: Run the installer file and follow the straightforward on-screen instructions.
- 3. Start Creating: Open WPS Office to seamlessly view, edit, and create your documents, spreadsheets, and presentations.

Frequently Asked Questions
Can I embed external Access forms by compiling the application?
No. Compiling an Access application does not embed or package external forms from referenced databases. The referenced MDB or ACCDB file remains independent and must be distributed alongside the main application.
How do I pass values to a form located in a referenced database?
You can pass values by creating a public function or subroutine inside the referenced database that accepts arguments. Your main application calls this function, passing the required values, which the function then applies to the form's controls.
What happens if the referenced Access database is missing during deployment?
If the main application cannot locate the referenced file at the specified path, it will trigger a broken reference error. Consequently, any code or forms reliant on that external database will fail to execute.




