When you use a wizard to create a list box or combo box, Microsoft Access sets certain properties for the control. 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.
Note If you're planning to use the bound list box or combo box on more than one form in an Access database (.mdb), you can set most of these properties in table Design view instead of using the control's property sheet. This way, you can specify the properties once. When you add the field to a form, Microsoft Access automatically creates the control based on the properties you specified.
Property | Description |
---|---|
RowSourceType | Works together with the RowSource property. You specify the type of row source (table/query, value list, field list, or Visual Basic function) by using this property, and then 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 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. 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 field names from the underlying row source for a combo box or list box are used as column headings in the combo box or list box. Headings appear in combo boxes only when the list is open. |
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 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 Microsoft 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. |
DisplayControl | Specifies the type of control (combo box or list box) that Microsoft Access creates by default when you add a Lookup field to a form. This property is available only on the Lookup tab in table Design view. |