| Version 3.5 | Approx 4.4 MB (zipped) | First Published 6 Mar 2019 | Last Updated 6 May 2026 |
|---|
This is the first in a series of articles showing different ways of filtering and grouping data in Access
This article focuses on the use of cascading combo boxes.
This approach is particularly useful where you have a very large dataset that would be impossibly slow to search using a single combo box or listbox.
For example, in my UK Postal Address Finder app (UKPAF), I have a table of 2.6 million postcodes.
For info, UK postcodes have 7 or 8 characters including a space.
Area
e.g. HA
District
e.g. HA3
Sector
e.g. HA3 0
Zone
e.g. HA3 0S
Postcode
e.g. HA3 0SN
For anyone interested, additional postcode info is provided in the
attached PDF file
NOTE:
All the above are official UK postcode terminology except zone (added here to assist with searching postcode sectors)
The normal postcode entry is a textbox. However, a postcode builder form is available when you aren't sure which postcode to enter.
Searching a dataset of this size is unmanageable using a single combo box. To make it manageable, the search is broken down using 5 cascading combo boxes.
The contents of each combo are dependant on the choices made in the previous combo which reduces the size of each list.
Each combo is based on a separate table filtered on the previous selection which makes it very fast. In addition, all fields used in the combo searches are indexed. This increases the database size BUT dramatically reduces the search time needed.
The attached example is a cut down version of the postcode builder used with the UKPAF application to make the file small enough to upload here.
It only has data for two of the 125 postcode areas in the UK - Bristol (BS) & Kirkwall (KW). Inactive postcodes have been removed from the list.
This reduces the total number of postcodes to around 28500 instead of the full data set of 2.6 million.
It also contains an example postcode map. Please keep this in the same folder as the database.
Click the OK button to start using the postcode builder.
A dropdown box appears with a list of postcode areas. Select an area from the list
Further dropdown boxes appear in turn for district, sector and zone until you select a full postcode using the final combobox.
In the UK Postal Address Finder app, a Google static map is automatically downloaded.
The map is centred on the geo-coordinates for the selected postcode and can be zoomed in/out.
In the attached example, the mapping feature has been removed. Instead it just uses the same example map for each postcode
Download
Click to download an example app with all code:
Postcode Builder Example (zipped)
As is the case for all files downloaded from the internet, first unblock the downloaded file, unzip then save to a trusted location.
For more details, see my article:
Unblock downloaded files by removing the Mark of the Web
A PDF is also available with additional infor about UK postcodes:
UK Postcode Info (PDF)
NOTE:
The FMS website has another example of the use of cascading combo boxes.
I haven't tested that example. However, since writing this article, I've had feedback from several people that it contains some flaws.
UPDATE 6 May 2026
Over 7 years after I wrote this article and the Access team have just updated the 365 roadmap to announce that cascading combo boxes (and listboxes) will be made available without any code required, with the rollout starting in Aug 2026. This is welcome news.
An early draft of the feature was demonstrated at the Access DevCon conference in April 2026. Linked Master Field and Child Field properties will be added to the property sheet for both comboboxes and listboxes, significantly simplifying the process of linking controls as code will be no longer required.
Feedback
Please use the E-Mail button in the contact form below to let me know whether you found this article useful or if you have any questions.
Please also consider making a donation towards the costs of maintaining this website. Thank you
Colin Riddington
Mendip Data Systems
Last Updated 6 May 2026
|
Return to Example Databases Page
|
Return to Top
|