In some situations it is better to link to the existing data instead of bringing it into the Access database. Linking allows you to see the current version of the data in Access and yet keep it available for other programs to use. You could still use the data with the original program, for example, a spreadsheet program.
You can only link tables, not queries or other objects like charts, logos, or images.
The icon in the Navigation Pane for a linked table has an arrow and an icon for the type of object it is.
Examples of Icons for Linked Table:
Access
table
Excel worksheet
Text
file
dBase
file
If you move or rename the source file for a linked table or rename the table inside the source file, the link breaks. Links will NOT be updated automatically. You can manually update the link(s) with the Linked Table Manager or recreate the link(s). But, you must still have access to the source file and know how to tell Access where it is from the location of the Access database. This will be difficult unless you have planned for it! You must think carefully before deciding to link.
For most table and field properties you must make any changes to the source table from inside the original program.
If the design of a linked table is changed in the original program, Access will use those changes, too, but you will probably need to relink to the table with the Linked Table Manager. If you change your password or user name to access the table, you will have to relink to the table.
Work-around for some properties: Create a form or report and set the properties for the controls that are bound to your fields. But... any properties that were set in the source table, like a ValidationRule, are still in effect. So be careful!
Relationships: If you import or link to two or more tables from a database, any relationships between those tables are imported also.
![]() |
Step-by-Step: Link to Tables |
![]() |
What you will learn: | to link to a table to create relationships between tables to add a Currency data type fields to linked table to type a character not on the keyboard to break links by changing database name to repair broken links with Linked Table Manager to break links by changing table name |
Start with: , worldtravel-Lastname-Firstname.accdb, projects-Lastname-Firstname.accdb
You created a Projects database in earlier in this project and saved it to your Class disk. The new World Travel database has more data on the staff than the Projects database has in its Staff table, but it does not have any of the data on projects. You will link to the tables in the Projects database and create a new relationship. The StaffID numbers are the same for both tables, or else this would not work well!
If necessary, open the database worldtravel-Lastname-Firstname.accdb from the databases project3 folder in your Class disk.
Have you made a backup of the database lately?
From the ribbon tab External Data in the Import & Link tab group, click on the Access button .
The Get External Data - Access Database dialog appears.
Navigate to your Class disk to the folder databases project3 and select the file projects-Lastname-Firstname.accdb.
Click on the option "Link to the data source by creating a linked table."
Click on OK.
The Link Tables dialog appears.
Select the tables Projects and Project Staff.
Click on OK.
The
tables show in the Navigation Pane with the icon for a linked table.
Linked tables that have a relationship still have that relationship in the new database.
Click on the Relationships button
in the Database Tools ribbon tab.
If necessary, click on the Show All Relationships button .
There are three sets of joins:
Click on the Show Table button to open the Show Table dialog, and add the missing table Clients.
Arrange them neatly, similar to the illustration:
Create the relationships shown in the
illustration:
Project Staff to Staff matching StaffID with EmployeeID
Trips to Staff matching AgentID with StaffID
Clients to Trips on ClientID
Problem:
Wrong fields were matched
You dragged a matching field from one table to another but dropped it
on the wrong field,
Solution: Click on the join line to select it. (It will get wider.)
Press the Delete key. A confirmation message box appears. Click on OK to
continue to delete the relationship.
Note: When linking tables, you must be careful to match the correct fields and that those fields
have the correct data types. The field names do NOT have to be the same for the relationship to work correctly. But the data type MUST match. This is a particular problem with linked
tables, where mismatches can easily occur.
Click the Save button on the toolbar to save your changes.
Close the Relationships window.
The Projects table needs more records and two more fields, Cost and Budget. You can add data to a linked table and make some changes to the table design, but not many. The properties Format, Input Mask, Decimal Places, and Caption can be changed. The table's name can be changed, also.
Select the data type Currency.
The currency formatting will match the default currency from the
Regional and Language Options dialog in the Control Panel. If you choose
English - American, you see $ as the currency symbol and a period before
the decimal part of a number. If you choose Spanish - Paraguay, you see
Gs as the currency symbol and a comma before the decimal portion of the
value. You must know what country you are in!
The default value for a number field is zero. You won't have
a null value for this type of field.
Complete records 1-3 with their cost and budget numbers, as in the illustration.
A standard font has more characters in it than show on the keyboard. There are special key combos that will let you type these characters. The Character Map app can show you what the key combo is. One of the new records you will enter below has a Portugese character that is not on an English keyboard.
Problem:
How to type characters not on the keyboard
To type ã in the medical conference record
below (for São Paulo), hold the ALT key down and on the numeric keypad press 0227. Now you know one code! You can find the code for other characters in the Character Map program that comes with Windows. If your keyboard does not have a numeric keypad, you will have to open Character Map and copy and paste the symbol.
ProjectName | ProjectDescription | Cost | Budget |
---|---|---|---|
Late Winter Sale | Promoting travel to warm climates at end of winter season | $225.00 | $250.00 |
Recruitment for Australia | Campaign to hire agents and other staff for the new Australia regional office | $5,125.00 | $5,000.00 |
BMA Medical Conference | Meeting planning/setup for medical conference in São Paulo, Brazil | $8000.00 | |
Networking Upgrade | Researching choices for systems and vendors for a new network | $100.00 |
Some versions use the default value of $0 when a Currency field is left blank.
Close and save the table.
Switch to the Projects database.
The Projects table shows the new records. Sweet!
Problem: New records are not showing
Solution: Refresh the view by pressing the F5 key on your keyboard or click the Refresh All button on the Home ribbon tab.
Close the Projects database and return to the World Travel database.
Switch to Table Design View for the linked Projects table.
A message appears at the bottom right of of window tells you that the current property (the ProjectID field) cannot be modified in a linked table.
If you do not notice this message and make a change anyway, you will see a popup message.
That's not completely true. Some properties apply only in the current database.
Hover over the options button until the down arrow appears, then click.
Two
choices appear - to update this change everywhere the field Budget
is used or to open Help about such updating.
Click on "Help on propagating field properties" and read the
article that appears. (This article is in the online Help articles.)
A field's properties which are set in the table's design are carried forward
to any controls on forms and reports that use that
field. But, if you make a change to the field later, you must propagate the change or those controls will not know about the change.
If the Projects database is renamed or moved, the links to its tables will break.
Open the linked table Projects in Datasheet View.
Whoops. A message appears telling you that Access cannot find the
database file that contains the linked table. Of course not! You changed its name.
The same message would appear if you moved the file to a different
folder or disk or if you moved the World Travel database.
Nothing about the link in the Navigation Pane changed to show you that there was a problem.
Access has a utility feature called Linked Table Manager to help you repair the link. You just have to be able to find the database!
On
the External Data ribbon tab, click on the button Linked Table Manager
.
The Linked Table Manager dialog appears listing the linked
tables and the path to the source database for each one.
The dialog allows you to update the links individually if you wish. If
all the linked tables are from the same database, you can update them
all at once.
Another way to break a link is to change the name of the table in the original database.
Open the linked table Projects .
An error message appears telling you that Access cannot find a table
with that name.
Switch back the the Projects database and change the table's name back to Projects.
When you do not want to change a
table's name back, you can use the Linked Tables Manager to update the link to
the new table name.