logo
search
Others

How to Use a Form from Another Access Database Without Copying

Khadija KhanKhadija Khan Oct 9, 2026 870 views

Question details

The user wants to utilize a form stored in an external Access database file from their main application without duplicating the form.

How to Use a Form from Another Access Database
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.
Before you start

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.

Solution 1Recommended

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.

1
Open the VBA Editor

Open your main Access database and press ALT + F11 to launch the Visual Basic for Applications (VBA) editor.

2
Add a Database Reference

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.

3
Create a Public Wrapper Function

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.

4
Call the Form from the Main Database

In your main database's VBA code, simply call the public function you created in the external database to trigger the form to open.

Set Up a Database Reference to Access External Forms
Deployment Requirement: The referenced database file must be deployed with your main application. If the file path changes on the deployment machine, the reference will break.
Free Microsoft Office alternative

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. 1. Download the Installer: Visit the official WPS Office website and click the free download button.
  2. 2. Install the Suite: Run the installer file and follow the straightforward on-screen instructions.
  3. 3. Start Creating: Open WPS Office to seamlessly view, edit, and create your documents, spreadsheets, and presentations.
Free to download and use for daily office tasksFully compatible with Microsoft Word, Excel, and PowerPoint formatsLightweight application that saves system resourcesFamiliar tabbed interface for a seamless and quick migration
QA img-9

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.