List box and combo box in access
Create a list box, combo box, or drop-down list boxMicrosoft Office Access 2003previous page next page
Change the sort order in a list box, combo box, or drop-down list boxIf you used a wizard to create the list box, drop-down list box, or combo box, Microsoft Access automatically sorts the rows that make up the list by the first visible column. If you want to specify a different sort order, or if you have set the RowSource property of the control to a saved query, you can use one of the following two procedures. NoteWizards are not available in a stand-alone data access page, or in a data access page that is connected to a database other than the one currently open. In this case, you will have to create a list box or drop-down list box on your own.
Bind a column from a list box, combo box, or drop-down list box
Use an SQL statement as the row source for a list box or combo box on a formYou might want to use an SQL statement instead of a saved query for the row source of a list box or combo box on a form so that the query doesn't show up in the Database window. However, list boxes and combo boxes based on SQL statements are slower than list boxes and combo boxes based on saved queries.
Hide a column in a list box or combo box on a form
NoteIn a combo box, the first visible column is displayed in the text box portion of the combo box when the list isn't displayed. For example, the SupplierName column in the previous example would be displayed because the SupplierID column is hidden. If the SupplierID column weren't hidden, it would be the only column that was displayed. Add column headings to a combo box on a form
Turn off the fill-in-as-you-type feature for a combo box on a form
Set the width of the list box portion of a combo box on a form
Set the maximum number of rows to display in a combo box on a form
Limit combo box entries to items in the list portion of a combo box on a form
Notes If the first column displayed in a combo box is not the bound column, Microsoft Access limits the entries to the list even if the LimitToList property is set to No. If the LimitToList property is set to No, when you enter an entry that isn't in the list, if the combo box is bound, the entry is stored in the underlying field, but it isn't added to the list. To add new entries to the list, use the OnNotInList property and the NotInList event. previous page start next page
|