How to Append Access Records When Source and Destination Keys Differ
Question details
The user needs to append booking information to another table upon confirmation, but the source and destination tables use different primary keys, and confirmed costs may differ from quoted costs.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Transferring or appending confirmed booking records to a new table where the actual costs differ from the initial quoted costs, complicating the primary key matching.
- Observed behavior
- Attempting to append records with differing primary keys leads to complex workarounds like inserting dummy values or duplicating unchanged data across tables.
Map out the relationships between your source and destination tables on paper. Identify which fields are unique to the confirmed booking (such as actual cost) and which fields remain unchanged (such as customer details).
Create a Related Table with a Foreign Key
Instead of duplicating the entire source table, create a new table specifically for the confirmed data and link it using a foreign key.
In a relational database, duplicating data across multiple tables violates normalization principles and can lead to inconsistencies. By creating a separate table for the confirmed booking details, you can track changes efficiently without redundant data.
Open Microsoft Access, go to the Create tab, and select Table Design. Create a new table specifically for confirmed or actual costs.
Add a new field (e.g., ConfirmedCostID) and set its Data Type to AutoNumber. Right-click the field name and select Primary Key.
Add a field that matches the Primary Key of your original booking table (e.g., BookingID) and set it to the appropriate Number data type. This will act as your Foreign Key.
Add fields for the data that differs upon confirmation, such as ActualCost (Currency type) and DateEntered (Date/Time type).
Go to Database Tools > Relationships. Drag the Primary Key from your original table to the Foreign Key in your new table to enforce referential integrity.

Update Existing Records Instead of Appending
If you only need to track one or two new variables, add them to the original table and update the record rather than moving it to a new table.
Manage Data Easily with WPS Office
While Microsoft Access is a powerful tool for complex relational databases, many users find that managing flat-file data, tracking costs, and generating reports is much easier in spreadsheet software. WPS Office is a free, lightweight suite that offers robust spreadsheet capabilities and is fully compatible with Microsoft Office formats.
- 1. Visit the WPS website: Go to the official WPS Office website to download the latest version.
- 2. Download the installer: Click the 'Download WPS Office Free' button and save the installer file to your computer.
- 3. Install and manage data: Run the installer, open WPS Spreadsheet, and start organizing your tabular data effortlessly.

Frequently Asked Questions
Why shouldn't I just duplicate the entire source table in Access?
Duplicating the entire source table creates redundant data. If customer details change, you would have to update them in multiple places. It is better to use relationships and foreign keys to reference unchanged data.
What is a foreign key in a Microsoft Access database?
A foreign key is a field in one table that uniquely identifies a row of another table. It matches the primary key of the related table, allowing Access to cross-reference data and maintain referential integrity.
Can I use an Append Query if the primary keys between tables don't match?
Yes, but you must map the fields carefully in the query design grid. If the destination table uses an AutoNumber primary key, you should exclude that field from the Append Query so Access automatically generates a new ID for the incoming records.




