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.

Do you need help with Microsoft Access?

Comeau Software Solutions specializes in the development and enhancement of Microsoft Access applications. We can also rescue Access projects that have gone off-track and provide assistance when it's time to move to another solution. Please contact us for more information on how we can help you with your database needs.

Also, check out our online course Managing Your Data with Microsoft Access. You can learn how to build and manage your own applications and work with your data more efficiently!

Powered by BetterDocs