dbFront automatically creates cascading dropdowns when you have multi-key relationships chained to simpler relationships.
A multi-key or composite relationship is any single relationship that involves multiple fields joining two tables. If dbFront is able to find a simpler relationship on the parent table involving a subset of those fields then it will create a cascading dropdown.
Starting Table Structures
First Cascading Dropdown
The first step is to create a simple relationship from ProductModel to ProductTable for the ProductID column. This will cause dbFront to show a simple lookup on the ProductModel table for the column ProductID.
The second step is to create a relationship from InvoiceTable to ProductModel as a composite relationship (multiple fields).
Because the fields ProductID and ProductModelID are part of a single relationship, dbFront will manage them together instead of treating the fields as individual lookups.
The result of this configuration is that InvoiceTable will have two dropdowns. dbFront will follow the relationship from the InvoiceTable through ProductModel to the ProductTable and realize that the ProductID dropdown should be a lookup on the ProductTable. Once you fill out the ProductID dropdown, dbFront will allow you to pick from the second dropdown on ProductModelID which will be filtered by the previous dropdown to only show matching records.
- dbFront uses the column order in the composite relationship to determine how the cascade flows. Therefore it expects form fields to appear in the same sequence.
- Selecting a higher-order column automatically resets the dependent dropdowns.
Additional Cascading Dropdowns
Additional Cascading Dropdowns can be added by extending the relationship chain. Examples of multilevel cascading dropdowns are:
- Make - Model - Color,
- Category - Products - Vendor - Model,
- Subdivision location from combined:
- [Country - Region - City]
- [Country - Region - Electoral District]
- In order for a cascading dropdown to work, dbFront must be able to travel up a relationship chain and arrived at the topmost single field lookup.
- To see what dbFront is thinking open the lookup field properties and open [Lookup Details]. Under the [Lookup Details] tab you will find another tab named [Lookup Source] which displays the relationships that dbFront considers relevant and which specific relationship it selected.