Adding (All) Options to Combo Boxes or List Boxes in Access 2007
3 minutes to read
This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
Summary: Learn how to add an (All) entry to the list of items displayed in a list box or combo box in Access 2007.
Applies to: 2007 Microsoft Office System, Microsoft Office Access 2007
Joel Krist, Akona Systems
Developers frequently use list boxes and combo boxes in Microsoft Office Access 2007 forms to let users specify selection criteria. Adding an (All) option to the list of items can be helpful in scenarios when users might want to select all the items in the list.
This Office Visual How To illustrates how to add an (All) entry to the list of items displayed in a list box or combo box in Access 2007.
The next step is to direct Access to call the new AddAllToList function when it inserts items into the item list of a list or combo box.
To set the RowSourceType property
To open the form that contains the list box or combo box in design view, in the Navigation Pane, right-click the form's name, and then select Design View.
Right-click the list or combo box on the form and select Properties.
In the Properties dialog box, select the Data tab to display the data-related properties.
Locate the RowSourceType property and set its value to AddAllToList.
Save the form and then display it in Form View. The list of items in the list or combo box should now display an (All) item.
Developers use list boxes and combo boxes in Access 2007 forms to let users specify selection criteria. For example, a common scenario is to bind a combo box display list to an Access database table and map the list items to the items in the table rows. In some scenarios, it might be useful to add an (All) option to the list of items so that the user can specify all items in the combo box.
To add an (All) item to the list, you first create a custom function that adds the option to the list box or combo box, and then you set the RowSourceType property to the name of this function.