How to add '(all)' to a combo box or a list box control in an Access 2000 application (210290)
The information in this article applies to:
This article was previously published under Q210290 For a Microsoft Access 97 version of this article,
see
128881. Advanced: Requires expert coding,
interoperability, and multiuser skills. This article applies only to a
Microsoft Access database (.mdb). SUMMARY This article shows you how to create a sample user-defined
Microsoft Visual Basic function that is called AddAllToList(). This article also shows you how to create a Union Query. You can
use either the function or the Union query to add "(all)" as the first row of
any existing combo box or list box control in a Microsoft Access application.
The sample application, Solutions9.mdb, is available from the
following Microsoft Web site: The sample application demonstrates a similar technique for
adding "(all)" to a list. However, the AddAllToList() function has the following advantages:
- The AddAllToList() function works with any existing combo box or list box control.
- You can specify in which column "(all)" is displayed.
- You can specify what you want the optional text to be. For
example, you can change "(all)" to "none" or "nothing."
- You do not need to change the code to change the optional
text.
REFERENCESFor more information about combo boxes, click Microsoft Access Help on the Help menu, type combo boxes: what they are and how they
work in the Office Assistant or the Answer Wizard, and then click Search to view the topics returned. To find
information, instructions, and examples in the sample application
(Solutions9.mdb), visit the following Microsoft Web site: For more information about adding "(all)" to a combo box or list
box, follow these steps:
- Open the Solutions9.mdb database.
- In the Select A Category Of Examples box,
click Work with combo boxes, list boxes, subforms, and
subreports.
- In the Select An Example box, click
Add '(all)' to a list, and then click OK.
Modification Type: | Major | Last Reviewed: | 6/23/2005 |
---|
Keywords: | kbfunctions kbhowto kbinfo kbusage KB210290 |
---|
|