Filtering Combo Boxes in Microsoft Access

Combo boxes are extremely useful in Microsoft Access and other design environments. They provide a compact control from which your users can access a drop-down menu that enables them to choose from a variety of options.

In my applications, combo boxes often pull their rows from lookup tables such as product or customer lists and this gives them the added advantage of being automatically updated as those tables get updated.

Sometimes, however, you need to limit the rows available to a combo box, removing rows that were previously available. In Access, this has the unfortunate side effect of making past entries appear blank since the lookup information is no longer available.

One way to fix this is to dynamically update the box’s RowSource property so, when a user clicks on the drop-down control, the RowSource changes to a filtered selection of rows and then changes back after the Combo Box loses focus so it can access whatever rows it needs.

In my latest video, I demonstrate how to do this in Microsoft Access using just a little bit of VBA and a couple of SQL statements. It really is very simple and makes your program interface that much more capable.

If you find this video helpful, check out my online course, Managing Your Data with Microsoft Access, which contains over 4 1/2 hours of video instruction that will help you design Access apps from the ground up.

Comeau Software Solutions can help you with your Microsoft Access project or find alternative solutions for your database needs. If you need assistance and would like more information, please contact us for details.

Sign up for our newsletter to receive updates about new projects, including the upcoming book "Self-Guided SQL"!

We respect your privacy and will never share your information with third-parties. See our privacy policy for more information.