Properties of list boxes, combo boxes, drop-down list boxes, and Lookup fields

ShowProperties you can use to create or modify list boxes and combo boxes on a form

When you use a wizard to create a list box or combo box, Microsoft Access sets certain properties for the control (control: A graphical user interface object, such as a text box, check box, scroll bar, or command button, that lets users control the program. You use controls to display data or choices, perform an action, or make the user interface easier to read.). You can work with these properties directly if you don't want to use a wizard to create the control, or you can use a wizard to create the control and then modify these properties to make the control work just the way you want. To find out more about any of the following properties, click the property in the property sheet and press F1.

In an Access database (Microsoft Access database: A collection of data and objects (such as tables, queries, or forms) that is related to a particular topic or purpose.), or in an Access project (Microsoft Access project: An Access file that connects to a Microsoft SQL Server database and is used to create client/server applications. A project file doesn't contain any data or data-definition-based objects, such as tables and views.) connected to Microsoft SQL Server 2000 or Microsoft SQL Server 2000 Desktop Engine, you can also use these properties to customize a Lookup field (Lookup field: A field, used on a form or report in an Access database, that either displays a list of values retrieved from a table or query, or stores a static set of values.).

Property Description
RowSourceType Works together with the RowSource property. You use this property to specify the type of row source (Table/Query, Table/View/StoredProc, Value List, Field List, or Visual Basic function (Function procedure: A procedure that returns a value and that can be used in an expression. You declare a function with the Function statement and end it with the End Function statement.)), and then you specify the actual row source in the RowSource property.
RowSource Specifies the name of the table, query, or SQL statement if RowSourceType is set to Table/Query. Specifies the entries in the list, separated by semicolons, if RowSourceType is set to Value List. Specifies the name of the table or query if RowSourceType is set to Field List. Is blank if RowSourceType is set to a function name.
BoundColumn In a bound (bound control: A control used on a form, report, or data access page to display or modify data from a table, query, or SQL statement. The control's ControlSource property stores the field name to which the control is bound.) multiple-column list box or combo box, specifies which column is bound to the underlying field specified in the ControlSource property. Data in that column will be stored in the field when you select that item in the list. This data may be different from the data that appears in the list if you hide the column.
ColumnCount Specifies the number of columns in a list box or combo box. You can include a column but not display it in a list by setting the ColumnWidths property to 0. You might want to do this if you have a list that looks up values from a table or query. You could include an ID field but hide it in the list. In a combo box, the first visible column in the list appears in the text box portion of the combo box.
ColumnWidths Specifies the width of each column, separated by semicolons. Enter 0 to hide a column. Enter a semicolon without a measurement to use the default (about 1 in. or 2.5 cm, depending on the unit of measurement set in Windows Control Panel). In a combo box, the first visible column appears in the text box portion of the control. The data type of any value you type in the combo box must be the same as or compatible with the data type of the first visible column.
ColumnHeads Determines whether the list box or combo box has column headings. If the combo box or list box is based on a record source (record source: The underlying source of data for a form, report, or data access page. In an Access database, it could be a table, query, or SQL statement. In an Access project, it could be a table, view, SQL statement, or stored procedure.), Access uses the field or column names from the record source as the column headings. If the combo box or list box is based on a fixed value list, Access uses the first x items of data from the value list (RowSource property) as the column headings, where x = the number set in the ColumnCount property. Headings appear in combo boxes only when the list is dropped down.
ListWidth Specifies the width of the list box portion of a combo box.
ListRows Specifies the maximum number of rows to display in the list box portion of a combo box.
LimitToList Determines whether a combo box accepts any entered text or only text that matches one of the values in the list. If you want to allow a new value that a user enters to be added to the list, set the property to No and attach an event procedure (event procedure: A procedure that is automatically executed in response to an event initiated by the user or program code, or that is triggered by the system.) to the OnNotInList property.
OnNotInList Runs the attached event procedure when the NotInList event occurs. You can use this property to automatically add a new value to a list. This property isn't available on the Lookup tab in table Design view.
AutoExpand Specifies whether Access automatically fills in a value that matches the characters that you type in a combo box. This property isn't available on the Lookup tab in table Design view — Access automatically fills in a value for a Lookup field. However, you can change the AutoExpand property of a combo box based on a Lookup field.
DisplayControl Specifies the type of control (combo box or list box) that Access creates by default when you add a Lookup field (Lookup field: A field, used on a form or report in an Access database, that either displays a list of values retrieved from a table or query, or stores a static set of values.) to a form. This property is available only on the Lookup tab in table Design view.

ShowProperties you can use to create or modify a list box or a drop-down list box in a data access page

When you use a wizard to create a list box or a drop-down list box (drop-down list box: A control on a data access page that, when clicked, displays a list from which you can select a value. You cannot type a value in a drop-down list box.) in a data access page (data access page: A Web page, published from Access, that has a connection to a database. In a data access page, you can view, add to, edit, and manipulate the data stored in the database. A page can also include data from other sources, such as Excel.), Access sets certain properties for the control (control: A graphical user interface object, such as a text box, check box, scroll bar, or command button, that lets users control the program. You use controls to display data or choices, perform an action, or make the user interface easier to read.). You can work with these properties directly if you don't want to use a wizard to create the control, or you can use a wizard to create the control and then modify these properties to make the control work just the way you want. To find out more about any of the following properties, click the property in the property sheet and press F1.

Property Description
ListRowSource The name of a record set in the data source that supplies the values and text for the list box or drop-down list box.
ListBoundField In a bound list box or drop-down list box, specifies which field is bound to the underlying data source specified in the ListRowSource property. Data in that column will be stored in the field when you select that item in the list.
ListDisplayField In a bound list box or drop-down list box, specifies the name of a field in the ListRowSource that provides the display values that correspond to the ListBoundField values.
 
 
Applies to:
Access 2003