ACC1x: Error in Column Property Help Menu Topic

Last reviewed: April 2, 1997
Article ID: Q95325
The information in this article applies to:
  • Microsoft Access versions 1.0, 1.1

SYMPTOMS

When you search for "Column," then "Column Property" using the Microsoft Access Help menu, some of the remarks are not correct.

RESOLUTION

When you use the Column property to reference a specific column in a combo box or list box, use Column(0) to refer to the first column, Column(1) to refer to the second column, and so on. In other words, the numbering begins with 0, not 1.

Incorrect Statement in the Column Property Help Topic

You can use the Column property to refer to a particular column in a multiple-column combo box or list box. Use 1 to refer to the first column, 2 to refer to the second column, and so on.

Corrected Version

You can use the Column property to refer to a particular column in a multiple-column combo box or list box. Use 0 to refer to the first column, 1 to refer to the second column, and so on.

STATUS

This behavior no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

To create a multiple-column combo box, set the RowSource property to include more than one column, and set the ColumnCount property to a number greater than one. To refer to each column in the combo box, use the Column property and include a reference number. Here is the syntax:

   Forms![Form Name]![Control Name].Column(#)

Replace the pound sign (#) with the reference number. The reference number is 0 for first column in the control, 1 for the second column, 2 for the third, and so on.

Here is a step-by-step example that demonstrates how to use the Column property reference number correctly:

  1. Open the NWIND.MDB sample database, and create a new, blank (unbound) form.

  2. Add a combo box and a text box to the new form. Use the following as a guide to set the properties for each control:

          Object: Combo Box
          -----------------
    
             ControlName:   My Combo Box
             RowSource:     Employees (a table)
             ColumnCount:   3
             ColumnWidth:   0,1,1
             BoundColumn:   1
    
          Object: Text Box
          ----------------
             ControlName:   My Text Box
             ControlSource: =[Forms]![Column Example]![My Combo Box].Column(2)
    
       Because you set ColumnCount to 3 and RowSource to the Employees table,
       Microsoft Access loads the combo box with values from the first three
       fields in the Employees table: Employee ID, Last Name, and First Name.
       Because you set the width of the first column to 0 in the ColumnWidth
       property, the first column (Employee ID) does not show up in the combo
       box. The 2 in the Column(2) in the ControlSource setting for the text
       box, refers to the third column (First Name), not the second (Last
       Name).
    
    

  3. Save the form, and name it Column Example.

  4. Switch to Form view, and select a name from the combo box list.

The combo box list displays the Last Name and First Name fields for each employee in the Employees table. When you select a name from the list, Microsoft Access displays the last name in the combo box and the first name in the text box.


Additional query words: properties controls
Keywords : DcmOthr kbusage
Version : 1.0 1.1
Platform : WINDOWS
Hardware : X86
Issue type : kbdocerr


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 2, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.