How to Link Access Forms and Automatically Populate Contract IDs
Question details
The user needs to set up an Access form so that creating a new contract record from a proposal form automatically populates the related ProposalID foreign key.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Managing one-to-one relational data between proposals and contracts using Access forms.
- Observed behavior
- A new contract record needs to automatically inherit the primary key (ProposalID) from the active proposal form without requiring manual data entry.
Verify that your tables (tblProposals and tblContracts) have a genuine one-to-one relationship defined in the Database Tools relationship window, and that referential integrity is enforced.
Use a Main Form with a Linked Subform
Placing the contract form as a subform inside the proposal form allows Access to automatically manage the foreign key relationship.
This approach leverages the Link Master Fields and Link Child Fields properties in Access. When these are properly configured, any new record created in the subform automatically inherits the ID of the current record displayed in the main form.
Open your main proposal form in Design View by right-clicking it in the Navigation Pane and selecting 'Design View'.
Drag the tblContracts table or your contract form from the Navigation Pane directly onto the main form's design grid to create a subform control.
Select the newly added subform control. Open the Property Sheet (F4), navigate to the 'Data' tab, and set both the 'Link Master Fields' and 'Link Child Fields' properties to 'ProposalID'.
Switch back to Form View. When you begin typing data into the contract subform, the ProposalID will now automatically populate based on the currently active proposal.

Create a Single Form Based on a LEFT JOIN Query
For a strict one-to-one relationship, you can merge both tables into a single query and use a Tab Control to separate the fields visually on one form.
Manage Your Data Easily with WPS Office
While Microsoft Access is used for complex relational databases, tracking lists, proposals, and contracts can often be handled more intuitively using a spreadsheet. WPS Office provides a lightweight, highly compatible, and free alternative to Microsoft Office, making data tracking simple and efficient without the steep learning curve of database management.
- 1. Download WPS Office: Visit the official WPS website and download the free installation package.
- 2. Install the Software: Run the installer and follow the on-screen instructions to complete the setup.
- 3. Open WPS Spreadsheet: Launch WPS Office, open Spreadsheet, and easily import your existing data to start managing your proposals and contracts.

Frequently Asked Questions
Why is the related ID not populating in my subform automatically?
This usually occurs if the 'Link Master Fields' and 'Link Child Fields' properties on the subform control are blank or incorrectly configured. Ensure both are exactly set to your primary key, such as ProposalID, in the Property Sheet under the Data tab.
Can I use a command button to open a related form instead of using a subform?
Yes. You can add a Command Button to the main form, use the Button Wizard to select 'Form Operations' > 'Open Form', and choose the option to find specific data to display. This synchronizes the newly opened form to the ProposalID of the current record.
What does enforcing referential integrity mean in Access?
Enforcing referential integrity prevents orphaned records in your database. In this scenario, it ensures you cannot create or save a contract record unless it is linked to a valid, existing proposal record.




