Split database: front end and back end
When several people work with the same database, you split it: the tables live in the back end on a network drive, forms, reports and code in a front end on each user’s computer. The front end reaches the data through linked tables.
In short: a linked table holds the path to the back end in its Connect property, such as ;DATABASE=C:\Data\Shop_be.accdb; for local tables Connect is empty. When the back end moves, code sets Connect to the new path and calls RefreshLink.
Before you start: Import and export.
Why split?
- Everyone has their own front end: changes to forms do not disturb anyone entering data.
- You hand out a new front end without touching the data.
- The back end holds only tables and relationships and is easy to back up.
Finding linked tables
The TableDefs collection holds every table, including system tables such as MSysObjects. A table is linked when Connect is not empty; SourceTableName gives its name in the back end. RecordCount returns -1 for linked tables; count them with DCount.
Task After splitting, some tables are linked to the back end. Write the procedure ListLinks: for every linked table (Connect not empty) it writes the name and the connection to the Immediate window, separated by “ | ”.
Customers 25 rows, 10 columns
| CustomerID | Company | FirstName | LastName | City | PostalCode | Country | CustomerSince | Regular | Discount |
|---|---|---|---|---|---|---|---|---|---|
| 1 | Noah | Evans | Leeds | LS1 1UR | UK | 28 Feb 2023 | ☑ | 0.1 | |
| 2 | Shaw & Partners | Noah | Davies | Glasgow | G1 1XQ | UK | 5 Feb 2024 | ☐ | 0.03 |
| 3 | Northlight Inc | Sophia | Hall | Denver | 80202 | USA | 30 Jun 2024 | ☑ | 0 |
| 4 | Olivia | Evans | Bristol | BS1 4DJ | UK | 29 Jun 2022 | ☑ | 0 | |
| 5 | Olivia | Smith | London | EC1A 1BB | UK | 23 Sep 2025 | ☑ | 0 | |
| 6 | Northlight Inc | Mia | Evans | Manchester | M1 1AE | UK | 1 Feb 2025 | ☐ | 0.1 |
| 7 | Bauer Ltd | Ava | Wilson | UK | 14 Oct 2024 | ☐ | 0.05 | ||
| 8 | Lucas | Taylor | Glasgow | G1 1XQ | UK | 2 Jul 2023 | ☐ | 0 | |
| 9 | Jack | Clark | Seattle | 98101 | USA | 7 Nov 2022 | ☐ | 0.1 | |
| 10 | Northlight Inc | Henry | Taylor | Denver | 80202 | USA | 3 Nov 2022 | ☑ | 0.1 |
| 11 | Northlight Inc | Oliver | Johnson | Bristol | BS1 4DJ | UK | 6 Mar 2024 | ☐ | 0 |
| 12 | Henry | Taylor | Chicago | 60601 | USA | 24 Dec 2023 | ☐ | 0 | |
| 13 | Northlight Inc | Noah | Taylor | London | EC1A 1BB | UK | 12 Oct 2022 | ☐ | 0 |
| 14 | Summit Consulting | Mia | Smith | Austin | 78701 | USA | 6 Feb 2022 | ☑ | 0 |
| 15 | Mia | Clark | Austin | 78701 | USA | 9 Mar 2022 | ☑ | 0.05 | |
| 16 | Chloe | Hall | Seattle | 98101 | USA | 4 May 2022 | ☐ | 0.03 | |
| 17 | Market Street Clinic | Sophia | Johnson | Boston | 02108 | USA | 4 Jun 2023 | ☑ | 0 |
| 18 | Roth Legal | Mia | Wright | Manchester | M1 1AE | UK | 23 Sep 2022 | ☑ | 0.05 |
| 19 | Northlight Inc | Grace | Wright | UK | 16 Dec 2023 | ☐ | 0.03 | ||
| 20 | Northlight Inc | Olivia | Brown | Boston | 02108 | USA | 19 Jun 2023 | ☐ | 0.03 |
| 21 | Liam | Brown | Boston | 02108 | USA | 23 Jun 2025 | ☐ | 0.03 | |
| 22 | Bauer Ltd | James | Johnson | Manchester | M1 1AE | UK | 5 Jun 2025 | ☐ | 0.05 |
| 23 | Noah | Wilson | Austin | 78701 | USA | 23 May 2022 | ☐ | 0 | |
| 24 | Market Street Clinic | James | Smith | Bristol | BS1 4DJ | UK | 16 Jan 2022 | ☐ | 0.1 |
| 25 | Northlight Inc | Sophia | Hall | Denver | 80202 | USA | 4 Aug 2025 | ☑ | 0 |
Relinking
After you change Connect, RefreshLink reconnects the table. If the file does not exist, Access reports 3044 (“'…' is not a valid path.”); on a local table Connect cannot be set (3219 “Invalid operation.”).
Task The back end now lives in C:\Data\Shop_be.accdb. Write the procedure Relink: it points every linked table to this file and refreshes the link.
Customers 25 rows, 10 columns
| CustomerID | Company | FirstName | LastName | City | PostalCode | Country | CustomerSince | Regular | Discount |
|---|---|---|---|---|---|---|---|---|---|
| 1 | Noah | Evans | Leeds | LS1 1UR | UK | 28 Feb 2023 | ☑ | 0.1 | |
| 2 | Shaw & Partners | Noah | Davies | Glasgow | G1 1XQ | UK | 5 Feb 2024 | ☐ | 0.03 |
| 3 | Northlight Inc | Sophia | Hall | Denver | 80202 | USA | 30 Jun 2024 | ☑ | 0 |
| 4 | Olivia | Evans | Bristol | BS1 4DJ | UK | 29 Jun 2022 | ☑ | 0 | |
| 5 | Olivia | Smith | London | EC1A 1BB | UK | 23 Sep 2025 | ☑ | 0 | |
| 6 | Northlight Inc | Mia | Evans | Manchester | M1 1AE | UK | 1 Feb 2025 | ☐ | 0.1 |
| 7 | Bauer Ltd | Ava | Wilson | UK | 14 Oct 2024 | ☐ | 0.05 | ||
| 8 | Lucas | Taylor | Glasgow | G1 1XQ | UK | 2 Jul 2023 | ☐ | 0 | |
| 9 | Jack | Clark | Seattle | 98101 | USA | 7 Nov 2022 | ☐ | 0.1 | |
| 10 | Northlight Inc | Henry | Taylor | Denver | 80202 | USA | 3 Nov 2022 | ☑ | 0.1 |
| 11 | Northlight Inc | Oliver | Johnson | Bristol | BS1 4DJ | UK | 6 Mar 2024 | ☐ | 0 |
| 12 | Henry | Taylor | Chicago | 60601 | USA | 24 Dec 2023 | ☐ | 0 | |
| 13 | Northlight Inc | Noah | Taylor | London | EC1A 1BB | UK | 12 Oct 2022 | ☐ | 0 |
| 14 | Summit Consulting | Mia | Smith | Austin | 78701 | USA | 6 Feb 2022 | ☑ | 0 |
| 15 | Mia | Clark | Austin | 78701 | USA | 9 Mar 2022 | ☑ | 0.05 | |
| 16 | Chloe | Hall | Seattle | 98101 | USA | 4 May 2022 | ☐ | 0.03 | |
| 17 | Market Street Clinic | Sophia | Johnson | Boston | 02108 | USA | 4 Jun 2023 | ☑ | 0 |
| 18 | Roth Legal | Mia | Wright | Manchester | M1 1AE | UK | 23 Sep 2022 | ☑ | 0.05 |
| 19 | Northlight Inc | Grace | Wright | UK | 16 Dec 2023 | ☐ | 0.03 | ||
| 20 | Northlight Inc | Olivia | Brown | Boston | 02108 | USA | 19 Jun 2023 | ☐ | 0.03 |
| 21 | Liam | Brown | Boston | 02108 | USA | 23 Jun 2025 | ☐ | 0.03 | |
| 22 | Bauer Ltd | James | Johnson | Manchester | M1 1AE | UK | 5 Jun 2025 | ☐ | 0.05 |
| 23 | Noah | Wilson | Austin | 78701 | USA | 23 May 2022 | ☐ | 0 | |
| 24 | Market Street Clinic | James | Smith | Bristol | BS1 4DJ | UK | 16 Jan 2022 | ☐ | 0.1 |
| 25 | Northlight Inc | Sophia | Hall | Denver | 80202 | USA | 4 Aug 2025 | ☑ | 0 |
This exercise is part of Premium.
Premium unlocks every exercise in every lesson, unlimited practice with fresh tasks and the final test with certificate.
See Premium Already Premium? Log in
The first exercise in this lesson is free.
In real Access
- Make a backup first. The wizard for splitting is on the Database Tools tab; it moves the tables into a new file and links them.
- Put the back end on the network drive and point the links to the new path: in code as in the exercise, or with the linked-table manager on the External Data tab.
- Hand the front end out to every user.
Compact and repair
An Access file grows with use: the space of deleted records and objects is not freed on its own, and Access leaves temporary objects behind. Compact and Repair removes the unused space and repairs damage in the file; it does not compress the data. An Access database can be at most 2 GB.
- Nobody else may have the file open: compacting needs exclusive access. Make a backup first.
- Open the database and choose Database Tools, Compact and Repair Database (also under File, Info).
- In a split database, compact the back end as well: open the back-end file itself and compact it there. Compacting the front end does not shrink the tables in the back end.
For a database only you use, Compact on Close does it automatically (File, Options, Current Database). With several users, leave it off, because compacting briefly blocks the file.
Common mistakes
CurrentDb on every line
Set tdf = CurrentDb.TableDefs("Customers") gives a TableDef that is invalid after the statement (3420). Use Set db = CurrentDb first, then db.TableDefs(…).
Drive letters
A path with a drive letter only works if every computer maps the network drive to the same letter. A UNC path such as \Server\Share\Shop_be.accdb does not depend on that.
FAQ
Does the front end need relinking when data changes?
No. You only relink when the back end moves or the table structure changes.
How many users can a split Access database handle?
Microsoft gives the technical maximum of 255 concurrent users. With many simultaneous writes, a database server as the back end is the sturdier choice.