This is a normalization issue. Apart from the foreign key, the only non-key columns in the subform's table should be those which are functionally determined solely by the table's primary key. Otherwise the table would not be normalized to Third Normal
Form (3NF), and consequently open to the risk of update anomalies. In most cases the values of no other columns from the referenced table, apart from the key, should be repeated in the referencing table. The values of the columns in the referenced table
can be shown in the subform, however, either by referencing the combo box's Column property as Duane describes, or simply by basing the subform on a query which includes the referenced table, joined on CourseNumber. You can then bind text box controls in
the subform to the relevant columns in the referenced table. The Locked property of these controls should be set to True (Yes), and their Enabled property should be set to False (No) to make them read-only.
In those exceptional cases where it is necessary to repeat a non-key column, e.g. a UnitPrice column from a referenced Products table in an OrderDetails table, then the price looked up from the Products table should be assigned to the UnitPrice column in the
OrderDetails table in the product combo box's AfterUpdate event procedure.
You'll find examples of both scenarios in DatabaseBasics.zip in my public databases folder at:
https://onedrive.live.com/?cid=44CC60D7FEA42912&id=44CC60D7FEA42912!169
Note that if you are using an earlier version of Access you might find that the colour of some form objects such as buttons shows incorrectly and you will need to amend the form design accordingly.
If you have difficulty opening the link, copy the link (NB, not the link location) and paste it into your browser's address bar.
In this little demo file the section on 'Inserting data via a form/subforms' incudes a simple Orders form. In this, when a customer is selected in the bound combo box, the customer's address is shown in the unbound controls below the combo box, by
referencing the combo box's Column property. The combo box's RowSource property is:
SELECT Contacts.ContactID, Contacts.Address, Cities.City,
Regions.Region, Countries.Country,
[LastName] & ", " & [FirstName] AS Customer
FROM (Countries INNER JOIN Regions
ON Countries.CountryID = Regions.CountryID)
INNER JOIN (Cities INNER JOIN Contacts
ON Cities.CityID = Contacts.CityID)
ON Regions.RegionID = Cities.RegionID
ORDER BY Contacts.LastName, Contacts.FirstName;
It's ColumnWidths property is 0cm;0cm;0cm;0cm;0cm;8cm to hide all bar the last column, the contact's name.
In the OrderDetails subform on the other hand the current unit price of the selected item is assigned to the UnitPrice column with the following code in the item combo box's AfterUpdate event procedure:
' assign current unit price from Items table
' to UnitPrice column in OrderDetails table
Me.UnitPrice = Me.ItemID.Column(1)
This means that while the price of an item will change over time in the referenced Items table, the price current at the time the order was made will remain static in the OrderDetails table. In each table the UnitPrice column is functionally determined solely
by the table's primary key, so both tables are normalized to 3NF, and there is no redundancy.