Hack #79. Help Users Drill Down to a Record

Facilitate browsing through a lengthy customer database by first grouping customers.

Sometimes users need to spend a lot of time finding a specific customer from a long list of customer records. For example, loading customer names into a combo box or a listbox requires your users to do a lot of scrolling.

Here's a technique that removes some of this drudgery. The first step is to provide a way to list smaller groups of customers. Figure 8-10 shows a form in which four buttons (on the left, inside the Browse Customers frame) lead to customers whose last names start with A–F, G–L, M–R, and S–Z.

Browsing customers within alphabetic groupings

Figure 8-10. Browsing customers within alphabetic groupings

Segregating the customers into four groups is subjective. You can apply this technique to even single letters; in other words, you can have 26 buttons. The more customers there are, the smaller the groupings should be. Keep in mind that the point is to present smaller lists of customers for users to browse through. If you have thousands of customers, a grouping such as A–F still results in a rather lengthy list.

Clicking any of the four buttons opens a form that is filtered to customers whose last name falls into the indicated grouping. For example, the code in the Click event for the A–F button looks like this:

 Private Sub cmdAF_Click( ) DoCmd.OpenForm "frmBrowseCustomers", acNormal, ...

Get Access Hacks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.