Microsoft KB Archive/202454

= ACC2000: Page Dropdown and List Box Can Only Display One Column =

Article ID: 202454

Article Last Modified on 12/12/2002

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q202454



Novice: Requires knowledge of the user interface on single-user computers.

This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).



SYMPTOMS
When you add a drop-down list box or a list box to a data access page, you see only one column of data.

If you are using the Control Wizard, you can enter two columns, but you can only see one of those columns. If you are using the Control Wizard and you try to add more than two columns, you receive one of the following messages:

No more than 2 fields can be selected.

-or-

A number from 1 to 2 must be entered.

After you click OK to the message, you may see the following error message:

Subscript out of range.



CAUSE
You cannot set the ListDisplayField property of the dropdown list and list box controls to multiple fields.

When you use the Control Wizard to add a dropdown list or a list box control, you cannot add more than two columns. The ListDisplayField property contains the values that you see. The wizard uses the column that you do not see to set the ListBoundField property.



MORE INFORMATION
Drop-down list boxes and list boxes are designed to display a single column when used in a data access page. You can specify different column names for the ListDisplayField and the ListBoundField properties, but only the field name specified for the ListDisplayField property will be displayed on the page.

Steps to Reproduce Behavior

 * 1) Open the sample database Northwind.mdb.
 * 2) In the Database window, click Pages under Objects, and then click New.
 * 3) In the New Data Access Page dialog box, click Design View. Click OK.
 * 4) If it is not enabled (pressed in), click the Control Wizards button in the toolbox to turn on the Control Wizards. Then click the Dropdown List in the toolbox, and add a drop-down list box to the page.
 * 5) On the first screen of the Combo Box Wizard, click I want the combo box to look up the values in a table or query. Click Next.
 * 6) In the Number of Columns box, type 3, and then press ENTER.

Note that you receive the second message listed in the "Symptoms" section.

