A family of Microsoft relational database management systems designed for ease of use.
As the relationship type from Classes to Areas is one-to-many you can keep the model down to three tables by the insertion of a Class foreign key into Areas, referencing the primary key of Classes. The model would thus, in broad outline, comprise tables like this:
Classes
….Class (PK)
Areas
….Area (PK)
….Class (FK)
ModificationCodes
….Code (PK)
….Class (FK)
The tables can of course include further non-key columns. Note that when correlated controls are used, the use of 'natural' keys, as above, has significant benefits, particularly in forms in continuous forms view.
As your users will be selecting an area, not a class, no correlation is required between the first two combo boxes, cboClass and cboArea, so their RowSource properties would be:
SELECT Class
FROM Classes
ORDER BY Class;
SELECT Area,
FROM Areas
ORDER BY Area;
The RowSource property for the cboModificationCode combo box would need to restrict the results to those rows from ModificationCodes where the Class foreign key column is the value determined by the selected area:
SELECT Code
FROM ModificationCodes
WHERE Class = Form!cboClass
ORDER BY Code;
In the cboArea control's AfterUpdate event procedure the cboClass control's value would be set to the Class for the selected area, and the cboModificationCode control then requeried:
Dim strCriteria As String
strCriteria = "Area = """ & Me.ActiveControl & """"
Me.cboClass = DLookup("Class", "Areas", strCriteria)
Me.cboModificationCode.Requery
Me.cboModificationCode = NULL
I've assumed in the above that Area is of short text data type.
As the user will not need to select a value in the cboClass combo box, that control can have its Enabled value set to False (No) or the control can even be hidden by setting its Visible property to False (No).