How to Use Conditional Logic and Related Subforms in Microsoft Access
Question details
Design an Access database utilizing conditional logic to display correct course units for students via a combo box and an editable related subform.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Setting up a relational database structure to manage students, courses, enrollments, and unit progress, ensuring forms update dynamically.
- Observed behavior
- Requires proper normalization and linking of master/child form fields so the subform correctly filters based on the selected student and course.
Before creating any forms, map out your entity relationships to ensure your database tables are properly normalized and linked.
Normalize Your Database Tables
Creating a solid foundation with separate, related tables is essential before building forms with conditional logic.
To avoid redundancy and ensure your forms work correctly, you must normalize your data. This means separating entities like students, courses, and units into their own tables rather than grouping them together.
Instead of adding unit columns directly to a course table, create a junction table for enrollments and progress. This allows you to add new courses and units without altering the underlying table or form design.
Create a table named tblCourses with fields such as CourseID (Primary Key) and CourseTitle.
Create a table named tblUnits that includes UnitID (Primary Key), CourseID (Foreign Key), and UnitTitle.
Set up a table to track individual progress containing StudentID, UnitID, CompletionDate, and TutorInitials to link students to specific unit outcomes.

Create and Link the Subform
Use the Form Wizard to build a subform that displays progress, then connect it to your main student form.
Looking for a Lightweight Office Suite for Daily Tasks?
While Microsoft Access is a powerful tool for building relational databases, you might also need an efficient, cost-effective solution for your everyday document, spreadsheet, and presentation tasks. WPS Office is a highly compatible, free alternative to Microsoft Office that handles Word, Excel, and PowerPoint formats seamlessly.
- 1. Download WPS Office: Visit the official WPS website to download the free installation package for your operating system.
- 2. Install the Software: Run the installer and follow the simple on-screen instructions to set up WPS Office.
- 3. Open Your Office Files: Launch WPS Office to easily open, edit, and save your existing Microsoft Office documents, spreadsheets, and presentations.

Frequently Asked Questions
Why shouldn't I store unit progress directly in the course table?
Storing progress directly in the course table limits your database structure. If a course changes or a student enrolls in multiple courses, you would have to alter the table design. Using a separate related progress table allows infinite flexibility without redesigning.
How do I make the subform update when I change the combo box value?
You need to ensure the Link Master Fields and Link Child Fields on the subform control are correctly mapped to the combo box's value. Alternatively, you can add a simple VBA macro to the 'After Update' event of the combo box that requeries the subform (e.g., Me.SubformName.Requery).
Can I edit records directly inside the filtered subform?
Yes, as long as the underlying recordset (query or joined tables) is updatable and the subform's 'Allow Edits' property is set to 'Yes' in the Property Sheet. Normalizing your tables correctly helps ensure the recordset remains editable.




