Automatically Populate Microsoft Access Subform Fields from a Combo Box
Question details
Display related course information automatically when a course number is selected in an Access subform.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- A subform records a course selection while course details are maintained in a separate CourseInfo table.
- Observed behavior
- Selecting a course number should display its title, prerequisites, credits, and discipline without duplicating those values in the related table.
Confirm that CourseInfo contains a unique course key and the four course detail fields, and that the subform's record source has a matching foreign-key field. The example assumes Course Number is the primary key; adjust the column order and bound column if your key is different.
Display Course Details Using Combo Box Columns
Use calculated text boxes to show current course details while storing only the selected course key.
In the Access Navigation Pane, right-click the subform and select Design View. Select the course combo box and open its Property Sheet.
On the Data tab of the Property Sheet, set Row Source to: SELECT [Course Number], [Course Title], Prerequisites, [Course Credits], [Discipline] FROM CourseInfo ORDER BY [Course Number];
Set Control Source to the subform's course foreign-key field and Bound Column to 1. On the Format tab, set Column Count to 5 and use Column Widths such as 1";0";0";0";0" to show only the course number in the list.
Add four text boxes to the subform. Set their Control Source properties to =[CourseCombo].Column(1), =[CourseCombo].Column(2), =[CourseCombo].Column(3), and =[CourseCombo].Column(4) for the title, prerequisites, credits, and discipline respectively. Replace CourseCombo with the actual combo box name.
Save the subform, switch to Form View, and select a course number from the combo box. Check that the four text boxes display the matching course details.

Store a Historical Course Value with AfterUpdate
Use this approach only when a course value must remain as it was at the time of selection.
Work with Course Lists in WPS Office
WPS Office is a free, lightweight alternative for working with course lists in spreadsheets. Its familiar interface and Microsoft Office format compatibility make it easy to move spreadsheet files, though it does not modify Access databases or fix Access forms.

Frequently Asked Questions
Why does Column(1) return the course title?
The Column property uses zero-based indexes. With Course Number first in the Row Source, Column(0) returns the number and Column(1) returns the title.
Which field should the combo box store?
Set the combo box's Control Source to the course foreign-key field in the subform's record source. Set Bound Column to the row-source column containing the CourseInfo primary key.
Will the calculated text boxes save course details in the subform table?
No. A Control Source such as =[CourseCombo].Column(1) displays a value from the combo box. To preserve a historical value, assign it to a bound field in the combo box's AfterUpdate event.
Can I show course details without using combo box columns?
Yes. Create a query that joins the subform's table to CourseInfo on the course key, then use it as the subform's Record Source to display the related fields.




