Customizing Lists and Drop Down Menus

In This Chapter

^ Programming combo boxes and list boxes ^ Linking lists

^ Updating one form's control from another form ^ Cool combo box tricks

7yping information into forms takes time, and typing always means the possibility of typographical errors. Any time you can eliminate typing by giving the user something to click, you're making your data entry quicker and more accurate.

Combo boxes and list boxes are both good tools for giving the user options to choose from when typing would otherwise be necessary. A combo box is basically a text box with a drop-down arrow on the right, as in the left side of Figure 10-1. The options available to the user — also shown at the left side of Figure 10-1 — aren't visible until he or she clicks the drop-down arrow. The user can either type in the text box or choose an option from the drop-down menu.

The right side of Figure 10-1 shows an example of a list box. Like a combo box, the list box shows a list of options, but there's no hidden drop-down menu: The list (or at least some portion of it) is plainly visible. Also, with a list box, there's no place to type text. The user has to choose an option from the list by clicking it. The selected option is highlighted in the control.

Because both combo and list boxes display a list of options onscreen, they have many similar properties. For example, every combo box and list box has a Row Source property that defines where the list of options comes from. When you use the Control Wizards to create a combo or list box, the wizard sets the Row Source property according to how you answer its questions. In forms Design, you can set the Row Source property via the Properties sheet. From VBA, you can change the Row Source property by using the .RowSource keyword.

Figure 10-1:

Sample combo box and list box.

Figure 10-1:

Sample combo box and list box.

List box

Combo box menu visible Combo box

List box

0 0

Post a comment